From c9a8bbd7f5308b9d165b0d21ff9b49bcd4fc070e Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 6 Aug 2015 22:10:18 -0700 Subject: Suppress debug stepping into auto-loaded library code. * debug.c (debug_set_state, debug_restore_state): New functions. * debug.h (debug_state_t): New type. (debug_set_state, debug_restore_state): Declared, and defined as dummy macros in non-debug-support build. * lisplib.c (opt_dbg_autoload): New global variable. (lisplib_try_load): Disable or enable debugging around library loading based on opt_dbg_autoload option. * lisplib.h (opt_dbg_autoload): Declared. * txr.c (help): List --debug-autoload option. (no_dbg_support): New static function to avoid repeated code. (txr_main): Add debugger option. Change duplicate no debug support error messages into calls to no_dbg_support. * txr.1: Document --debug-autoload --- debug.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'debug.h') diff --git a/debug.h b/debug.h index c14a304c..3ae18cab 100644 --- a/debug.h +++ b/debug.h @@ -31,6 +31,11 @@ val debug(val form, val bindings, val data, val line, val pos, val base); #if CONFIG_DEBUG_SUPPORT +typedef struct { + int next_depth; + int step_mode; +} debug_state_t; + #define debug_enter \ { \ int debug_depth_save = debug_depth++; \ @@ -55,6 +60,8 @@ INLINE val debug_check(val form, val bindings, val data, val line, return (opt_debugger) ? debug(form, 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, \ @@ -77,6 +84,8 @@ void debug_init(void); #else +typedef int debug_state_t; + #define debug_enter { #define debug_leave } @@ -98,6 +107,9 @@ INLINE val debug_check(val form, val bindings, val data, val line, #define debug_end \ } while (0) +#define debug_set_state(D, S) (0) +#define debug_restore_state(S) ((void) 0) + INLINE void debug_init(void) { } -- cgit v1.2.3