fix the signal handling a bit better.
This commit is contained in:
parent
700ea83b17
commit
c1aba9a840
@ -1160,7 +1160,8 @@ throw(Ball) :-
|
||||
'catch_ball'(Ball, V) :-
|
||||
var(V),
|
||||
nonvar(Ball),
|
||||
functor(Ball, Name, _),
|
||||
Ball = error(Type,_), % internal error ??
|
||||
functor(Type, Name, _),
|
||||
atom_codes(Name, [0'$|_]), %'0
|
||||
!, fail.
|
||||
'catch_ball'(C, C).
|
||||
|
34
pl/debug.yap
34
pl/debug.yap
@ -340,33 +340,33 @@ debugging :-
|
||||
'$loop_spy'(GoalNumber, G, Module, CalledFromDebugger) :-
|
||||
yap_hacks:current_choice_point(CP),
|
||||
'$system_catch'('$loop_spy2'(GoalNumber, G, Module, CalledFromDebugger, CP),
|
||||
Module, '$debug_event'(Event),
|
||||
'$loop_spy_event'(Event, GoalNumber, G, Module, CalledFromDebugger)).
|
||||
Module, error(Event,Context),
|
||||
'$loop_spy_event'(error(Event,Context), GoalNumber, G, Module, CalledFromDebugger)).
|
||||
|
||||
% handle weird things happening in the debugger.
|
||||
'$loop_spy_event'('$retry_spy'(G0), GoalNumber, G, Module, CalledFromDebugger) :-
|
||||
'$loop_spy_event'(error('$retry_spy'(G0),_), GoalNumber, G, Module, CalledFromDebugger) :-
|
||||
G0 >= GoalNumber, !,
|
||||
'$loop_spy'(GoalNumber, G, Module, CalledFromDebugger).
|
||||
'$loop_spy_event'('$retry_spy'(GoalNumber), _, _, _, _) :- !,
|
||||
throw('$debug_event'('$retry_spy'(GoalNumber))).
|
||||
'$loop_spy_event'('$fail_spy'(G0), GoalNumber, G, Module, CalledFromDebugger) :-
|
||||
'$loop_spy_event'(error('$retry_spy'(GoalNumber),_), _, _, _, _) :- !,
|
||||
throw(error('$retry_spy'(GoalNumber),[])).
|
||||
'$loop_spy_event'(error('$fail_spy'(G0),_), GoalNumber, G, Module, CalledFromDebugger) :-
|
||||
G0 >= GoalNumber, !,
|
||||
'$loop_fail'(GoalNumber, G, Module, CalledFromDebugger).
|
||||
'$loop_spy_event'('$fail_spy'(GoalNumber), _, _, _, _) :- !,
|
||||
throw('$debug_event'('$fail_spy'(GoalNumber))).
|
||||
'$loop_spy_event'('$done_spy'(G0,G), GoalNumber, G, _, CalledFromDebugger) :-
|
||||
'$loop_spy_event'(error('$fail_spy'(GoalNumber),_), _, _, _, _) :- !,
|
||||
throw(error('$fail_spy'(GoalNumber),[])).
|
||||
'$loop_spy_event'(error('$done_spy'(G0),_), GoalNumber, G, _, CalledFromDebugger) :-
|
||||
G0 >= GoalNumber, !,
|
||||
'$continue_debugging'(CalledFromDebugger).
|
||||
'$loop_spy_event'('$done_spy'(GoalNumber), _, _, _, _) :- !,
|
||||
throw('$debug_event'('$done_spy'(GoalNumber))).
|
||||
'$loop_spy_event'(abort, _, _, _, _) :- !,
|
||||
throw('$abort').
|
||||
'$loop_spy_event'(error('$done_spy'(GoalNumber),_), _, _, _, _) :- !,
|
||||
throw(error('$done_spy'(GoalNumber),[])).
|
||||
'$loop_spy_event'(Event, GoalNumber, G, Module, CalledFromDebugger) :-
|
||||
'$debug_error'(Event),
|
||||
'$system_catch'(
|
||||
('$trace'(exception,G,Module,GoalNumber,_),fail),
|
||||
Module,'$debug_event'(NewEvent),
|
||||
'$loop_spy_event'(NewEvent, GoalNumber, G, Module, CalledFromDebugger)).
|
||||
Module,
|
||||
error(NewEvent,NewContext),
|
||||
'$loop_spy_event'(error(NewEvent,NewContext), GoalNumber, G, Module, CalledFromDebugger)
|
||||
).
|
||||
|
||||
|
||||
'$debug_error'(Event) :-
|
||||
@ -603,7 +603,7 @@ debugging :-
|
||||
halt.
|
||||
'$action'(0'f,_,CallId,_,_,_) :- !, % 'f fail
|
||||
'$scan_number'(0'f, CallId, GoalId), %'f
|
||||
throw('$debug_event'('$fail_spy'(GoalId))).
|
||||
throw(error('$fail_spy'(GoalId),[])).
|
||||
'$action'(0'h,_,_,_,_,_) :- !, % 'h help
|
||||
'$action_help',
|
||||
'$skipeol'(104),
|
||||
@ -653,7 +653,7 @@ debugging :-
|
||||
'$action'(0'r,_,CallId,_,_,_) :- !, % 'r retry
|
||||
'$scan_number'(0'r,CallId,ScanNumber), % '
|
||||
'$debug_on'(true),
|
||||
throw('$debug_event'('$retry_spy'(ScanNumber))).
|
||||
throw(error('$retry_spy'(ScanNumber),[])).
|
||||
'$action'(0's,P,CallNumber,_,_,on) :- !, % 's skip
|
||||
'$skipeol'(0's), % '
|
||||
( (P=call; P=redo) ->
|
||||
|
Reference in New Issue
Block a user