summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-12-18 06:46:31 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-12-18 06:46:31 -0800
commit9e7cb4f19473571d76bf4b7b5ddc772ef8375a4e (patch)
tree50c4c631fcfbf1e7254e027e131e160bb219ec11 /txr.c
parenta574f6c3f0d30b59cd0a0778e4e83e9cb0b4c724 (diff)
downloadtxr-9e7cb4f19473571d76bf4b7b5ddc772ef8375a4e.tar.gz
txr-9e7cb4f19473571d76bf4b7b5ddc772ef8375a4e.tar.bz2
txr-9e7cb4f19473571d76bf4b7b5ddc772ef8375a4e.zip
New --debug-expansion option.
* txr.c (opt_dbg_expansion): New global variable. (help): Print summary for --debug-expansion. (txr_main): Recognize new option and set flag. * parser.y (parse_once): Suppress debug stepping around parser if opt_dbg_expansion is false. * txr.1 (opt_dbg_expansion): Declared. * txr.1: Documented new option.
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/txr.c b/txr.c
index 991666bb..c1b3a838 100644
--- a/txr.c
+++ b/txr.c
@@ -63,6 +63,7 @@ static const char *progname_u8;
static val progpath = nil;
int opt_noninteractive;
int opt_compat;
+int opt_dbg_expansion;
val stdlib_path;
/*
@@ -154,6 +155,7 @@ static void help(void)
"--gc-delta=N Invoke garbage collection when malloc activity\n"
" increments by N megabytes since last collection.\n"
"--debug-autoload Allow debugger to step through library auto-loading.\n"
+"--debug-expansion Allow debugger to step through macro-expansion of query.\n"
"--yydebug Debug Yacc parser, if compiled with YYDEBUG support.\n"
"--gc-debug Enable a garbage collector stress test (slow).\n"
"--vg-debug Enable Valgrind integration, if compiled in.\n"
@@ -570,6 +572,15 @@ int txr_main(int argc, char **argv)
no_dbg_support(opt);
return EXIT_FAILURE;
#endif
+ } else if (equal(opt, lit("debug-expansion"))) {
+#if CONFIG_DEBUG_SUPPORT
+ opt_debugger = 1;
+ opt_dbg_expansion = 1;
+ continue;
+#else
+ no_dbg_support(opt);
+ return EXIT_FAILURE;
+#endif
} else if (equal(opt, lit("yydebug"))) {
if (have_yydebug) {
yydebug_onoff(1);