gdb
authorTom Tromey <tromey@redhat.com>
Wed, 10 Feb 2010 18:57:21 +0000 (18:57 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 10 Feb 2010 18:57:21 +0000 (18:57 +0000)
* 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.

gdb/ChangeLog
gdb/c-exp.y
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/parse.c
gdb/parser-defs.h

index 431ba1c7fed2bfdaea4db430a00c2f01096157a1..c5bf4f9ca1f2f56f91c9735bda715b3e04d80dff 100644 (file)
@@ -1,3 +1,12 @@
+2010-02-10  Tom Tromey  <tromey@redhat.com>
+
+       * 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.
+
 2010-02-10  H.J. Lu  <hongjiu.lu@intel.com>
 
        * target-descriptions.c (tdesc_type): Add TDESC_TYPE_I387_EXT,
index 8e00979ff8af3253c217f4f65b01c6ed9ce9a01b..845771c9b9678cd5d2fa6c54ece670288d198b13 100644 (file)
@@ -2450,6 +2450,9 @@ c_parse (void)
   gdb_assert (! macro_original_text);
   make_cleanup (scan_macro_cleanup, 0);
 
+  make_cleanup_restore_integer (&yydebug);
+  yydebug = parser_debug;
+
   /* Initialize some state used by the lexer.  */
   last_was_structop = 0;
   saw_name_at_eof = 0;
index dbd12dffc1323bebc843bcae6cb974dc1c4deb67..b5bef2f554772a602b778d22d276c6388a0c11d8 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-10  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.texinfo (Debugging Output): Document set debug parser and
+       show debug parser.
+
 2010-02-09  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gdb.texinfo (Predefined Target Types): Add i387_ext,
index 81c0b6bebc0a7fab13ac9fdf2331861db1f7d7e6..4fc064dda5c767a11e1a2f2dc6525d4a86e56acf 100644 (file)
@@ -18848,6 +18848,15 @@ is off.
 @item show debug overload
 Displays the current state of displaying @value{GDBN} C@t{++} overload
 debugging info.
+@cindex expression parser, debugging info
+@cindex debug expression parser
+@item set debug parser
+Turns on or off the display of expression parser debugging output.
+Internally, this sets the @code{yydebug} variable in the expression
+parser.  @xref{Tracing, , Tracing Your Parser, bison, Bison}, for
+details.  The default is off.
+@item show debug parser
+Show the current state of expression parser debugging.
 @cindex packets, reporting on stdout
 @cindex serial connections, debugging
 @cindex debug remote protocol
index d5a199bfc55d79d3fa74848dd700bb458514d7f9..aabc4616c8432323e7b3d18fc2fe1eaed4673a25 100644 (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);
 }
index 6fcf7ae53058e2b5cf4c1c8592645a4bd6495fe2..c4eb1a042a814713e6788501e8d6b606211215b8 100644 (file)
@@ -29,6 +29,8 @@
 
 struct block;
 
+extern int parser_debug;
+
 extern struct expression *expout;
 extern int expout_size;
 extern int expout_ptr;
This page took 0.055564 seconds and 4 git commands to generate.