aboutsummaryrefslogtreecommitdiff
path: root/gdb/parse.c
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2002-06-21 14:32:10 +0000
committerPierre Muller <muller@sourceware.org>2002-06-21 14:32:10 +0000
commitf461f5cf7932cc292cafd659b4bc101967f96dee (patch)
tree70e73ce75d2927180bd2f3555f7478a75d74d4ce /gdb/parse.c
parent19d833a2fa6c344238385c4edadb3ffdb9c71509 (diff)
downloadgdb-f461f5cf7932cc292cafd659b4bc101967f96dee.zip
gdb-f461f5cf7932cc292cafd659b4bc101967f96dee.tar.gz
gdb-f461f5cf7932cc292cafd659b4bc101967f96dee.tar.bz2
2002-06-19 Pierre Muller <muller@ics.u-strasbg.fr>
* parse.c (parse_fprintf): New function used to avoid calls to fprintf in bison parser generated debug code. * parser-defs.h: Declaration of new parse_fprintf function. * ada-exp.y, c-exp.y, f-exp.y, jv-exp.y, m2-exp.y, p-exp.y: Set YYDEBUG to 1 by default. Set YYFPRINTF as parse_fprintf.
Diffstat (limited to 'gdb/parse.c')
-rw-r--r--gdb/parse.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index bc81f22..c5de0af 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -1366,6 +1366,23 @@ build_parse (void)
NULL);
}
+/* This function avoids direct calls to fprintf
+ in the parser generated debug code. */
+void
+parser_fprintf (FILE *x, const char *y, ...)
+{
+ va_list args;
+ va_start (args, y);
+ if (x == stderr)
+ vfprintf_unfiltered (gdb_stderr, y, args);
+ else
+ {
+ fprintf_unfiltered (gdb_stderr, " Unknown FILE used.\n");
+ vfprintf_unfiltered (gdb_stderr, y, args);
+ }
+ va_end (args);
+}
+
void
_initialize_parse (void)
{