* 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.
This commit is contained in:
Tom Tromey
2010-02-10 18:57:21 +00:00
parent 9fd3625f79
commit 92981e2446
6 changed files with 48 additions and 0 deletions

View File

@@ -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);
}