Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: simon.marchi@polymtl.ca
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH v2 19/19] gdb: honor "set debug parser" in the Modula-2 and Pascal parsers
Date: Sat,  5 Sep 2026 00:23:22 -0400	[thread overview]
Message-ID: <20260905042353.1702204-20-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20260905042353.1702204-1-simon.marchi@polymtl.ca>

From: Simon Marchi <simon.marchi@polymtl.ca>

All expression parsers make the generated parser produce its debug output
when parser_state::debug is set, by setting their <prefix>_yydebug
variable, except the Modula-2 and Pascal ones.  Add it for Modula-2 and
Pascal.  As a side effect, this makes the declarations of these two
variables used, which they were not before.

Change-Id: If5b1abc053d1c20e2ad3cc5b4729ffebe13f5c4e
---
 gdb/m2-exp-parser.c | 3 +++
 gdb/p-exp-parser.c  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/gdb/m2-exp-parser.c b/gdb/m2-exp-parser.c
index 821f1507aef3..a1fff9f58c66 100644
--- a/gdb/m2-exp-parser.c
+++ b/gdb/m2-exp-parser.c
@@ -481,6 +481,9 @@ m2_parse (struct parser_state *par_state)
   pstate = par_state;
   paren_depth = 0;
 
+  scoped_restore restore_yydebug = make_scoped_restore (&m2_yydebug,
+							par_state->debug);
+
   int result = m2_yyparse ();
   if (!result)
     pstate->set_operation (pstate->pop ());
diff --git a/gdb/p-exp-parser.c b/gdb/p-exp-parser.c
index 108c839d3f51..c013eceecbfc 100644
--- a/gdb/p-exp-parser.c
+++ b/gdb/p-exp-parser.c
@@ -947,6 +947,9 @@ pascal_parse (struct parser_state *par_state)
   pstate = par_state;
   paren_depth = 0;
 
+  scoped_restore restore_yydebug = make_scoped_restore (&pascal_yydebug,
+							par_state->debug);
+
   int result = pascal_yyparse ();
   if (!result)
     pstate->set_operation (pstate->pop ());
-- 
2.55.0


      parent reply	other threads:[~2026-09-05  4:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-05  4:23 [PATCH v2 00/19] Move C++ support code out of .y files simon.marchi
2026-09-05  4:23 ` [PATCH v2 01/19] gdb/ada-exp-parser: remove name_info struct simon.marchi
2026-09-05  4:23 ` [PATCH v2 02/19] gdb: replace parse_type macros with functions simon.marchi
2026-09-05  4:23 ` [PATCH v2 03/19] gdb: suffix flex/bison output files with -gen.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 04/19] gdb: remove YY_NULL to YY_NULLPTR substitution simon.marchi
2026-09-05  4:23 ` [PATCH v2 05/19] gdb: move parser output post-processing to a script simon.marchi
2026-09-05  4:23 ` [PATCH v2 06/19] gdb: let the parser and lexer generators prefix their symbols simon.marchi
2026-09-05  4:23 ` [PATCH v2 07/19] gdb: separate cp-name-parser's symbol prefix with an underscore simon.marchi
2026-09-05  4:23 ` [PATCH v2 08/19] gdb: make $(YACC) and $(FLEX) generate headers simon.marchi
2026-09-05  4:23 ` [PATCH v2 09/19] gdb: add check for stale build generated files simon.marchi
2026-09-05  4:23 ` [PATCH v2 10/19] gdb: move cp-name-parser.y's support code to cp-name-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 11/19] gdb: rename LANG-exp.y to LANG-exp-parser.y simon.marchi
2026-09-05  4:23 ` [PATCH v2 12/19] gdb: move c-exp-parser.y's support code to c-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 13/19] gdb: move ada-exp-parser.y's support code to ada-exp-parser.c simon.marchi
2026-09-08 18:28   ` Kevin Buettner
2026-09-05  4:23 ` [PATCH v2 14/19] gdb: move d-exp-parser.y's support code to d-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 15/19] gdb: move f-exp-parser.y's support code to f-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 16/19] gdb: move go-exp-parser.y's support code to go-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 17/19] gdb: move m2-exp-parser.y's support code to m2-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 18/19] gdb: move p-exp-parser.y's support code to p-exp-parser.c simon.marchi
2026-09-05  4:23 ` simon.marchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260905042353.1702204-20-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox