From c1d9a00a81f08f9ea5adf9595fe4055d8866423d Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 17 Sep 2017 07:59:37 +0100 Subject: [PATCH] debugging --- pl/hacks.yap | 4 ++-- pl/signals.yap | 24 ++++++------------------ 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/pl/hacks.yap b/pl/hacks.yap index 7ac27f73c..a1213ced9 100644 --- a/pl/hacks.yap +++ b/pl/hacks.yap @@ -209,8 +209,8 @@ beautify_hidden_goal('$continue_with_command'(Command,V,P,G,Source),prolog) --> ['TopLevel'(Command,G,V,P,Source)]. beautify_hidden_goal('$spycall'(G,M,InControl,Redo),prolog) --> ['DebuggerCall'(M:G, InControl, Redo)]. -beautify_hidden_goal('$do_spy'(Goal, Mod, _CP, InControl),prolog) --> - ['DebuggerCall'(Mod:Goal, InControl)]. +beautify_hidden_goal('$spycall'(Goal, Mod, _CP, Expanded),prolog) --> + ['DebuggerCall'(Mod:Goal, Expanded)]. beautify_hidden_goal('$system_catch'(G,Mod,Exc,Handler),prolog) --> [catch(Mod:G, Exc, Handler)]. beautify_hidden_goal('$catch'(G,Exc,Handler),prolog) --> diff --git a/pl/signals.yap b/pl/signals.yap index e0603c407..fb741dfb3 100644 --- a/pl/signals.yap +++ b/pl/signals.yap @@ -25,7 +25,7 @@ :- use_system_module( '$_boot', ['$meta_call'/2]). -:- use_system_module( '$_debug', ['$do_spy'/4]). +:- use_system_module( '$_debug', ['$spycall'/4]). :- use_system_module( '$_threads', ['$thread_gfetch'/1]). @@ -160,7 +160,8 @@ order of dispatch. % never creep on entering system mode!!! % don't creep on meta-call. '$do_signal'(sig_creep, MG) :- - '$start_creep'(MG, creep). + '$disable_debugging', + '$start_creep'(MG, creep). '$do_signal'(sig_iti, [M|G]) :- '$thread_gfetch'(Goal), % if more signals alive, set creep flag @@ -215,26 +216,13 @@ order of dispatch. % we may be creeping outside and coming back to system mode. '$start_creep'([_M|G], _) :- - nonvar(G), +nonvar(G), G = '$$cut_by'(CP), !, '$$cut_by'(CP). -'$start_creep'([M|G], _) :- - '$is_no_trace'(G, M), !, - ( - '$$save_by'(CP), - '$no_creep_call'(G,M), - '$$save_by'(CP2), - '$disable_debugging', - (CP == CP2 -> ! ; ( true ; '$enable_debugging', fail ) ), - '$enable_debugging' - ; - '$disable_debugging', - fail - ). -'$start_creep'([Mod|G], WhereFrom) :- + '$start_creep'([Mod|G], _WhereFrom) :- CP is '$last_choice_pt', - '$do_spy'(G, Mod, CP, WhereFrom). + '$spycall'(G, Mod, CP, not_expanded). '$no_creep_call'('$execute_clause'(G,Mod,Ref,CP),_) :- !, '$enable_debugging',