diff --git a/pl/debug.yap b/pl/debug.yap index 6d05371db..01e4b22b4 100644 --- a/pl/debug.yap +++ b/pl/debug.yap @@ -136,8 +136,12 @@ mode and the existing spy-points, when the debugger is on. '$exec_spy'( M, G, Action ) :- - '$import_chain'( M, G, M0, S0 ), - '$system_predicate'(S0,M0), + '$follow_import_chain'( M, G, M0, G0 ), + '$exec_spy2'( M0, G0, Action ). + + +'$exec_spy2'( M0, S0, Action ) :- + '$system_predicate'(S0,M0), 1, '$flags'(S0,M0,F,F), ( F /\ 0x118dd080 =\= 0 @@ -149,6 +153,8 @@ mode and the existing spy-points, when the debugger is on. true ), '$suspy2'(Action, S0, M0 ). +'$exec_spy2'( M0, S0, Action ) :- + '$suspy2'(Action, S0, M0 ). '$suspy2'(spy,T,M) :- recorded('$spy','$spy'(T,M),_), !,