diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-04-09 01:10:15 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-04-09 01:10:15 -0700 |
commit | 3376e74aef0bd84a8dd3ef7c0c08a6a2d298dd7d (patch) | |
tree | 57050afdb62cf26ea305ab0d1055174bcd46c299 /debug.h | |
parent | e2f97e2e063f7c9b93407d2af4e8b6f163bea2ac (diff) | |
download | txr-3376e74aef0bd84a8dd3ef7c0c08a6a2d298dd7d.tar.gz txr-3376e74aef0bd84a8dd3ef7c0c08a6a2d298dd7d.tar.bz2 txr-3376e74aef0bd84a8dd3ef7c0c08a6a2d298dd7d.zip |
debug support: crude debugger removed.
* debug.c (debug_depth, debug_quit_s): Variables removed.
(step_mode, next_depth, breakpoints, last_command, cols):
Static variables removed.
(debug_check): C99 inline instantiation removed.
(help, show_bindings): Static functions removed.
(debug): Function removed.
(debug_set_state): Now takes one int argument, returns int.
It's anticipated that the new debug system will have a
simple on-off switch; there won't be a debug_depth hack.
(debug_restore_state): Function removed.
(debug_init): Emptied.
* debug.h (debug_depth, debug_state_t): Declarations removed.
(debug_enter, debug_leave, debug_return): Macros removed.
(debug_check): Inline function removed.
(debug_set_state): Declaration updated.
(debug_restore_state): Declaration removed.
(debug_frame, debug_end): Macros removed.
* eval.c (do_eval, me_interp_macro): Debugging support scrubbed.
* lisplib.c (lisplib_try_load): Adapt to debug_set_state
interface change.
* match.c (h_fun, do_match_line, v_fun, match_files,
match_fun): Debugging support scrubbed.
* parser.y (parse_once): Adapt to debug_set_state interface
change.
* protsym.c: Regenerated.
* signal.h (debug_depth): Declaration removed.
(EJ_DBG_MEMB, EJ_DBG_SAVE, EJ_DBG_REST): Macros removed.
(EJ_OPT_MEMB, EJ_OPT_SAVE, EJ_OPT_REST): Reduced to
unconditionally empty definitions for future use.
* unwind.c (uw_push_debug): Function removed.
* unwind.h (uw_frtype_t): UW_DBG enum member removed.
(struct uw_debug): struct declaration removed.
(union uw_frame): db member removed.
(uw_push_debug): Declaration removed.
* txr.1: Debugger doc removed.
Diffstat (limited to 'debug.h')
-rw-r--r-- | debug.h | 86 |
1 files changed, 8 insertions, 78 deletions
@@ -26,93 +26,23 @@ */ extern int opt_debugger; -extern int debug_depth; -val debug(val form, val bindings, val data, val line, val pos, val base); +int debug_state; #if CONFIG_DEBUG_SUPPORT -typedef struct { - int next_depth; - int step_mode; -} debug_state_t; - -#define debug_enter \ - { \ - int debug_depth_save = debug_depth++; \ - val debug_result = nil; \ - (void) 0 - -#define debug_leave \ - debug_return_out: \ - debug_depth = debug_depth_save; \ - return debug_result; \ - } - -#define debug_return(VAL) \ - do { \ - debug_result = VAL; \ - goto debug_return_out; \ - } while (0) - -INLINE val debug_check(val ctx, val bindings, val data, val line, - val pos, val base) -{ - return (opt_debugger) ? debug(ctx, bindings, data, line, pos, base) : nil; -} - -debug_state_t debug_set_state(int depth, int step); -void debug_restore_state(debug_state_t); void debug_init(void); -#define debug_frame(FUNC, ARGS, UBP, \ - BINDINGS, DATA, \ - LINE, CHR) \ - do { \ - uw_frame_t db_env; \ - if (opt_debugger) { \ - uw_push_debug(&db_env, FUNC, ARGS,\ - UBP, BINDINGS, DATA,\ - LINE, CHR); \ - } \ - (void) 0 - -#define debug_end \ - if (opt_debugger) { \ - uw_pop_frame(&db_env); \ - } \ - } while (0) - -#else - -typedef int debug_state_t; - -#define debug_enter { - -#define debug_leave } - -#define debug_return(VAL) return VAL - -INLINE val debug_check(val form, val bindings, val data, val line, - val pos, val base) +INLINE int debug_set_state(int state) { - return nil; + int ret = debug_state; + debug_state = state; + return ret; } -#define debug_frame(FUNC, ARGS, UBP, \ - BINDINGS, DATA, \ - LINE, CHR) \ - do { \ - (void) 0 - -#define debug_end \ - } while (0) - -#define debug_set_state(D, S) (0) -#define debug_restore_state(S) ((void) 0) +#else -INLINE void debug_init(void) -{ -} +#define debug_init() ((void) 0) +#define debug_set_state(S) 0 #endif |