Patchwork [PUSHED,05/11] gdb/fortran: Enable debugging of the Fortran parser

login
register
mail settings
Submitter Andrew Burgess
Date March 6, 2019, 6:14 p.m.
Message ID <b32bad11ef377e60b7aa1135516d46229741bb6c.1551895528.git.andrew.burgess@embecosm.com>
Download mbox | patch
Permalink /patch/31749/
State New
Headers show

Comments

Andrew Burgess - March 6, 2019, 6:14 p.m.
This commit allows 'set debug parser on' to work for the Fortran
parser.

gdb/ChangeLog:

	* f-exp.y (f_parse): Set yydebug.
---
 gdb/ChangeLog | 4 ++++
 gdb/f-exp.y   | 2 ++
 2 files changed, 6 insertions(+)

Patch

diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 5e980944b19..c223d366db3 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -1211,6 +1211,8 @@  f_parse (struct parser_state *par_state)
 {
   /* Setting up the parser state.  */
   scoped_restore pstate_restore = make_scoped_restore (&pstate);
+  scoped_restore restore_yydebug = make_scoped_restore (&yydebug,
+							parser_debug);
   gdb_assert (par_state != NULL);
   pstate = par_state;