summaryrefslogtreecommitdiff
path: root/gdb/parse.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-02-10 18:57:21 +0000
committerTom Tromey <tromey@redhat.com>2010-02-10 18:57:21 +0000
commit58228f24141f1eb924c896c386b3ba8befd9e2ca (patch)
treeb0604fe445a7cd55855412d95c834b4eb160eac3 /gdb/parse.c
parentc95a567addd264054ce9b32954f891f31af3ee57 (diff)
downloadgdb-58228f24141f1eb924c896c386b3ba8befd9e2ca.tar.gz
gdb
* parser-defs.h (parser_debug): Declare. * parse.c (_initialize_parse): Install "debug parser" set/show command. (parser_debug): New global. (show_parserdebug): New function. * c-exp.y (c_parse): Set yydebug. gdb/testsuite * gdb.texinfo (Debugging Output): Document set debug parser and show debug parser.
Diffstat (limited to 'gdb/parse.c')
-rw-r--r--gdb/parse.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index d5a199bfc55..aabc4616c84 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -109,6 +109,18 @@ show_expressiondebug (struct ui_file *file, int from_tty,
fprintf_filtered (file, _("Expression debugging is %s.\n"), value);
}
+
+/* Non-zero if an expression parser should set yydebug. */
+int parser_debug;
+
+static void
+show_parserdebug (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c, const char *value)
+{
+ fprintf_filtered (file, _("Parser debugging is %s.\n"), value);
+}
+
+
static void free_funcalls (void *ignore);
static int prefixify_expression (struct expression *);
@@ -1377,4 +1389,12 @@ When non-zero, the internal representation of expressions will be printed."),
NULL,
show_expressiondebug,
&setdebuglist, &showdebuglist);
+ add_setshow_boolean_cmd ("parser", class_maintenance,
+ &parser_debug, _("\
+Set parser debugging."), _("\
+Show parser debugging."), _("\
+When non-zero, expression parser tracing will be enabled."),
+ NULL,
+ show_parserdebug,
+ &setdebuglist, &showdebuglist);
}