make < debugger option work again

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@248 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-01-02 03:54:15 +00:00
parent c1943be66e
commit 2b72b6f71b
2 changed files with 26 additions and 8 deletions

View File

@ -11912,10 +11912,10 @@ shows the active goal using print/1
shows the active goal using display/1 shows the active goal using display/1
@item <Depth - debugger write depth @item <Depth - debugger write depth
sets the maximum write depth, both for composite terms and lists, that sets the maximum write depth, both for composite terms and lists, that
will be used by @code{write/1} or @code{write/2}. For more will be used by the debugger. For more
information about @code{write_depth/2} (@pxref{I/O Control}). information about @code{write_depth/2} (@pxref{I/O Control}).
@item < - full term @item < - full term
resets to infinite the debugger's maximum write depth. For resets to the default of ten the debugger's maximum write depth. For
more information about @code{write_depth/2} (@pxref{I/O Control}). more information about @code{write_depth/2} (@pxref{I/O Control}).
@end table @end table

View File

@ -839,7 +839,8 @@ debugging :-
'$set_yap_flags'(10, CL), '$set_yap_flags'(10, CL),
!, fail. !, fail.
'$action'(60,_,_,_) :- !, % <Depth '$action'(60,_,_,_) :- !, % <Depth
'$new_deb_depth'. '$new_deb_depth',
fail.
'$action'(94,_,_,G) :- !, '$action'(94,_,_,G) :- !,
'$print_deb_sterm'(G), fail. '$print_deb_sterm'(G), fail.
'$action'(97,_,_,_) :- !, abort. % a abort '$action'(97,_,_,_) :- !, abort. % a abort
@ -947,14 +948,17 @@ debugging :-
'$deb_get_sterm_in_g'(T,G,A1), '$deb_get_sterm_in_g'(T,G,A1),
arg(H,A1,A). arg(H,A1,A).
'$new_deb_depth' :- '$get_deb_depth'(0,D), '$new_deb_depth' :-
( '$recorded'('$debug_depth',_,R) -> erase(R) ; true ), '$get_deb_depth'(0,D),
( D \= 0 -> recorda('$debug_depth',D,_) ), '$set_deb_depth'(D).
fail.
'$get_deb_depth'(X0,XF) :- '$get_deb_depth'(X0,XF) :-
get0(user_input,C), get0(user_input,C),
'$get_depth_handle_char'(C,X0,XF). '$get_depth_handle_char'(C,X0,XI),
'$post_process_depth'(XI, XF).
'$post_process_depth'(0, 10) :- !.
'$post_process_depth'(X, X).
'$get_depth_handle_char'(10,X,X) :- !. '$get_depth_handle_char'(10,X,X) :- !.
'$get_depth_handle_char'(C,X0,XF) :- '$get_depth_handle_char'(C,X0,XF) :-
@ -963,6 +967,20 @@ debugging :-
'$get_deb_depth'(XI,XF). '$get_deb_depth'(XI,XF).
'$get_depth_handle_char'(C,X,X) :- '$skipeol'(C). '$get_depth_handle_char'(C,X,X) :- '$skipeol'(C).
'$set_deb_depth'(D) :-
recorded('$print_options','$debugger'(L),R), !,
'$delete_if_there'(L, max_depth(_), LN),
erase(R),
'$recorda'('$print_options','$debugger'([max_depth(D)|LN]),_).
'$set_deb_depth'(D) :-
'$recorda'('$print_options','$debugger'([quoted(true),numbervars(true),portrayed(true),max_depth(D)]),_).
'$delete_if_there'([], _, []).
'$delete_if_there'([T|L], T, LN) :- !,
'$delete_if_there'(L, T, LN).
'$delete_if_there'([Q|L], T, [Q|LN]) :-
'$delete_if_there'(L, T, LN).
'$DebugError'(error(Msg, Where )) :- !, '$DebugError'(error(Msg, Where )) :- !,
'$output_error_message'(Msg, Where), !, '$output_error_message'(Msg, Where), !,
fail. fail.