From 9c3d6a187dcfaed871dd264f6362c70278ac9876 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 26 Mar 2011 15:45:42 +0000 Subject: [PATCH] debugging cleanups actually use readline flag. --- C/sysbits.c | 1 + library/dialect/swi/fli/swi.c | 3 ++- packages/PLStream/pl-read.c | 3 --- pl/boot.yap | 4 +--- pl/flags.yap | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/C/sysbits.c b/C/sysbits.c index a4fd16c8b..e28cc2c0d 100755 --- a/C/sysbits.c +++ b/C/sysbits.c @@ -1553,6 +1553,7 @@ void (*handler)(int); static int InteractSIGINT(int ch) { + CACHE_REGS Yap_PrologMode |= AsyncIntMode; switch (ch) { case 'a': diff --git a/library/dialect/swi/fli/swi.c b/library/dialect/swi/fli/swi.c index 099813db7..cb4210473 100755 --- a/library/dialect/swi/fli/swi.c +++ b/library/dialect/swi/fli/swi.c @@ -1882,7 +1882,6 @@ PL_recorded(record_t db, term_t ts) X_API record_t PL_duplicate_record(record_t db) { - CACHE_REGS Term t = YAP_Recorded((void *)db); if (t == ((CELL)0)) return FALSE; @@ -2335,9 +2334,11 @@ X_API void PL_register_foreign_in_module(const char *module, const char *name, i Term tmod; Int nflags = 0; +#ifdef DEBUG if (flags & (PL_FA_NOTRACE|PL_FA_CREF)) { fprintf(stderr,"PL_register_foreign_in_module called with non-implemented flag %x when creating predicate %s:%s/%d\n", flags, module, name, arity); } +#endif if (module == NULL) { tmod = CurrentModule; } else { diff --git a/packages/PLStream/pl-read.c b/packages/PLStream/pl-read.c index 40cbfae8a..4f2654f9f 100644 --- a/packages/PLStream/pl-read.c +++ b/packages/PLStream/pl-read.c @@ -509,9 +509,6 @@ raw_read2(ReadData _PL_rd ARG_LD) _PL_rd->strictness = truePrologFlag(PLFLAG_ISO); source_line_no = -1; - fprintf(stderr,"write_prompt\n"); - jmp_deb(1); - for(;;) { c = getchr(); diff --git a/pl/boot.yap b/pl/boot.yap index 210b7c3c6..d917e1b39 100755 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -145,9 +145,7 @@ true :- true. /* main execution loop */ '$read_vars'(user_input, Goal, Mod, Pos, Bindings) :- - writeln(c:Raw), - get_value('$readline',true), !, - writeln(d:Raw), + '$swi_current_prolog_flag'(readline, true), !, read_history(h, '!h', [trace, end_of_file], ' ?- ', Goal, Bindings), diff --git a/pl/flags.yap b/pl/flags.yap index c8d3a496f..a1b039f89 100644 --- a/pl/flags.yap +++ b/pl/flags.yap @@ -563,7 +563,7 @@ yap_flag(system_options,X) :- '$system_options'(rational_trees) :- '$yap_has_rational_trees'. '$system_options'(readline) :- - '$has_readline'. + '$swi_current_prolog_flag'(readline, true). '$system_options'(tabling) :- \+ '$undefined'('$c_table'(_,_), prolog). '$system_options'(threads) :-