improve tracing over multi-arguments meatballs.

This commit is contained in:
Vítor Santos Costa 2015-11-13 13:20:29 +00:00
parent f17fae43e3
commit bc54d4458a

View File

@ -412,7 +412,18 @@ be lost.
'$continue_debugging'(fail, CalledFromDebugger), '$continue_debugging'(fail, CalledFromDebugger),
fail. fail.
% if we are in /**
* core routine for the debugger
*
* @param _ GoalNumbera id
* @param _ S9c
* @param _
* @param Retry
* @param Det
* @param false
*
* @return
*/
'$loop_spy2'(GoalNumber, G, Module, CalledFromDebugger, CP) :- '$loop_spy2'(GoalNumber, G, Module, CalledFromDebugger, CP) :-
/* the following choice point is where the predicate is called */ /* the following choice point is where the predicate is called */
'__NB_getval__'('$spy_glist',[Info|_],true), /* get goal list */ '__NB_getval__'('$spy_glist',[Info|_],true), /* get goal list */
@ -592,6 +603,13 @@ be lost.
fail fail
). ).
/**
* call predicate M:G within the ddebugger
*
*
* @return
*/
'$trace'(G,M) :- '$trace'(G,M) :-
( (
'$$save_by'(CP1), '$$save_by'(CP1),
@ -769,7 +787,9 @@ be lost.
throw(error('$retry_spy'(ScanNumber),[])). throw(error('$retry_spy'(ScanNumber),[])).
'$action'(0's,P,CallNumber,_,_,on) :- !, % 's skip '$action'(0's,P,CallNumber,_,_,on) :- !, % 's skip
'$skipeol'(0's), % ' '$skipeol'(0's), % '
( (P=call; P=redo) -> (
(P=call; P=redo) ->
'__NB_setval__'('$debug_run',CallNumber), '__NB_setval__'('$debug_run',CallNumber),
'__NB_setval__'('$debug_jump',false) '__NB_setval__'('$debug_jump',false)
; ;
@ -1019,9 +1039,36 @@ be lost.
G1 =.. [F|BG1s]. G1 =.. [F|BG1s].
'$ldebugger_process_meta_args'([], _, [], []). '$ldebugger_process_meta_args'([], _, [], []).
'$ldebugger_process_meta_args'([G|BGs], M, [0|BMs], ['$trace'(G1,M1)|BG1s]) :- '$ldebugger_process_meta_args'([G|BGs], M, [N|BMs], ['$trace_call'(G1,M1)|BG1s]) :-
number(N),
N > 0,
!, !,
strip_module( M:G, M1, G1 ), strip_module( M:G, M1, G1 ),
'$ldebugger_process_meta_args'(BGs, M, BMs, BG1s). '$ldebugger_process_meta_args'(BGs, M, BMs, BG1s).
'$ldebugger_process_meta_args'([G|BGs], M, [_|BMs], [G|BG1s]) :- '$ldebugger_process_meta_args'([G|BGs], M, [_|BMs], [G|BG1s]) :-
'$ldebugger_process_meta_args'(BGs, M, BMs, BG1s). '$ldebugger_process_meta_args'(BGs, M, BMs, BG1s).
'$trace_call'(G1,M1, A1) :-
'$trace_call'( call(M1:G1, A1 )).
'$trace_call'(G1,M1, A1, A2) :-
'$trace_call'( call(M1:G1, A1, A2 )).
'$trace_call'(G1,M1, A1, A2, A3) :-
'$trace_call'( call(M1:G1, A1, A2, A3 )).
'$trace_call'(G1,M1, A1, A2, A3, A4) :-
'$trace_call'( call(M1:G1, A1, A2, A3, A4 )).
'$trace_call'(G1,M1, A1, A2, A3, A4, A5) :-
'$trace_call'( call(M1:G1, A1, A2, A3, A4, A5 )).
'$trace_call'(G1,M1, A1, A2, A3, A4, A5, A6 ) :-
'$trace_call'( call(M1:G1, A1, A2, A3, A4, A5, A6 )).
'$trace_call'(G1,M1, A1, A2, A3, A4, A5, A6, A7) :-
'$trace_call'( call(M1:G1, A1, A2, A3, A4, A5, A6, A7 )).
'$trace_call'(G1,M1, A1, A2, A3, A4, A5, A6, A7, A8) :-
'$trace_call'( call(M1:G1, A1, A2, A3, A4, A5, A6, A7, A8 )).
'$trace_call'(G1,M1, A1, A2, A3, A4, A5, A6, A7, A8, A9) :-
'$trace_call'( call(M1:G1, A1, A2, A3, A4, A5, A6, A7, A8, A9 )).
'$trace_call'(G1,M1, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) :-
'$trace_call'( call(M1:G1, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10 )).
'$trace_call'(G1,M1, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) :-
'$trace_call'( call(M1:G1, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11 )).
'$trace_call'(G1,M1, EA1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) :-
'$trace_call'( call(M1:G1, EA1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 )).