debugger should use the same code that system uses to find undefined predicates.
This commit is contained in:
parent
f8806bed9f
commit
552d424ee0
15
pl/boot.yap
15
pl/boot.yap
@ -957,6 +957,10 @@ not(G) :- \+ '$execute'(G).
|
||||
|
||||
% Called by the abstract machine, if no clauses exist for a predicate
|
||||
'$undefp'([M|G]) :-
|
||||
'$find_goal_definition'(M, G, NM, NG),
|
||||
'$execute0'(NG, NM).
|
||||
|
||||
'$find_goal_definition'(M, G, NM, NG) :-
|
||||
% make sure we do not loop on undefined predicates
|
||||
% for undefined_predicates.
|
||||
'$enter_undefp',
|
||||
@ -965,20 +969,19 @@ not(G) :- \+ '$execute'(G).
|
||||
->
|
||||
'$exit_undefp'
|
||||
;
|
||||
once('$find_undefp_handler'(G,M,Goal,NM))
|
||||
once('$find_undefp_handler'(G, M, Goal, NM))
|
||||
),
|
||||
!,
|
||||
Goal \= fail,
|
||||
'$complete_goal'(M, Goal, NM, G).
|
||||
'$complete_goal'(M, Goal, NM, G, NG).
|
||||
|
||||
'$complete_goal'(M, G, CurMod, G0) :-
|
||||
'$complete_goal'(M, G, CurMod, G0, NG) :-
|
||||
(
|
||||
'$is_metapredicate'(G,CurMod)
|
||||
->
|
||||
'$meta_expansion'(G, CurMod, M, M, NG,[]) ->
|
||||
'$execute0'(NG, CurMod)
|
||||
'$meta_expansion'(G, CurMod, M, M, NG,[])
|
||||
;
|
||||
'$execute0'(G, CurMod)
|
||||
NG = G
|
||||
).
|
||||
|
||||
'$find_undefp_handler'(G,M,NG,user) :-
|
||||
|
12
pl/debug.yap
12
pl/debug.yap
@ -504,16 +504,8 @@ debugging :-
|
||||
( '$do_spy'(Cl, M, CP, CalledFromDebugger) ; InRedo = true ).
|
||||
'$spycall'(G, M, CalledFromDebugger, InRedo) :-
|
||||
'$undefined'(G, M), !,
|
||||
(
|
||||
recorded('$import','$import'(NM,M,Goal,G,_,_),_)
|
||||
->
|
||||
'$spycall'(Goal, NM, CalledFromDebugger, InRedo)
|
||||
;
|
||||
'$enter_undefp',
|
||||
'$find_undefp_handler'(G,M,Goal,NM)
|
||||
->
|
||||
'$spycall'(Goal, NM, CalledFromDebugger, InRedo)
|
||||
).
|
||||
'$find_goal_definition'(M, G, NM, Goal),
|
||||
'$spycall'(Goal, NM, CalledFromDebugger, InRedo).
|
||||
'$spycall'(G, M, _, InRedo) :-
|
||||
% I lost control here.
|
||||
CP is '$last_choice_pt',
|
||||
|
Reference in New Issue
Block a user