]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-06-19 Pierre Muller <muller@ics.u-strasbg.fr>
authorPierre Muller <muller@sourceware.org>
Fri, 21 Jun 2002 14:32:10 +0000 (14:32 +0000)
committerPierre Muller <muller@sourceware.org>
Fri, 21 Jun 2002 14:32:10 +0000 (14:32 +0000)
* 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.

gdb/ChangeLog
gdb/ada-exp.y
gdb/c-exp.y
gdb/f-exp.y
gdb/jv-exp.y
gdb/m2-exp.y
gdb/p-exp.y
gdb/parse.c
gdb/parser-defs.h

index 141b88ff4bf312eda206ac5a23ca05217259befe..074b58704e3f545b72e58285580783944150367c 100644 (file)
@@ -1,3 +1,12 @@
+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.
+
 2002-06-21  Michal Ludvig  <mludvig@suse.cz>
 
        * dwarf2cfi.c (read_encoded_pointer): Don't handle pointer 
index 7d46dd2cf8b749fa7a890ccf995815df41baa723..67185a3e497dd99791ce1763669a0bb68c96c87d 100644 (file)
@@ -92,9 +92,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define yytoks ada_toks                /* With YYDEBUG defined */
 
 #ifndef YYDEBUG
-#define        YYDEBUG 0               /* Default to no yydebug support */
+#define        YYDEBUG 1               /* Default to yydebug support */
 #endif
 
+#define YYFPRINTF parser_fprintf
+
 struct name_info {
   struct symbol* sym;
   struct minimal_symbol* msym;
index f555518ea0013c7ba40bf6e8135d1d89d185af52..ea5083646e0ef785a41e17281206659ad0d80f57 100644 (file)
@@ -100,9 +100,11 @@ extern int hp_som_som_object_present;
 #define yycheck         c_yycheck
 
 #ifndef YYDEBUG
-#define        YYDEBUG 0               /* Default to no yydebug support */
+#define        YYDEBUG 1               /* Default to yydebug support */
 #endif
 
+#define YYFPRINTF parser_fprintf
+
 int yyparse (void);
 
 static int yylex (void);
index e11687726ef5edf7be767e18da710e7794c357b4..a26f019fe96222d3bdd5cc512257162190e1b150 100644 (file)
@@ -102,9 +102,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define yycheck         f_yycheck
 
 #ifndef YYDEBUG
-#define        YYDEBUG 1               /* Default to no yydebug support */
+#define        YYDEBUG 1               /* Default to yydebug support */
 #endif
 
+#define YYFPRINTF parser_fprintf
+
 int yyparse (void);
 
 static int yylex (void);
index 495bf3e05379b53a16c14944039e6832dbef66c0..f95de247b1a43f58ca5e22ffbed96b46414e5b4e 100644 (file)
@@ -96,9 +96,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define yycheck         java_yycheck
 
 #ifndef YYDEBUG
-#define        YYDEBUG 0               /* Default to no yydebug support */
+#define        YYDEBUG 1               /* Default to yydebug support */
 #endif
 
+#define YYFPRINTF parser_fprintf
+
 int yyparse (void);
 
 static int yylex (void);
index 772c6b7b2860763bd265863746446853b40cd345..707c9e210913243f171b928bc7a9dc1af481429d 100644 (file)
@@ -98,9 +98,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define yycheck         m2_yycheck
 
 #ifndef YYDEBUG
-#define        YYDEBUG 0               /* Default to no yydebug support */
+#define        YYDEBUG 1               /* Default to yydebug support */
 #endif
 
+#define YYFPRINTF parser_fprintf
+
 int yyparse (void);
 
 static int yylex (void);
index 7333f6d04a0dbff8036b84a8ca150a42c723fa96..fbdd3f69e186990c9815899feebc2619cc898a43 100644 (file)
@@ -104,9 +104,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define yycheck         pascal_yycheck
 
 #ifndef YYDEBUG
-#define        YYDEBUG 0               /* Default to no yydebug support */
+#define        YYDEBUG 1               /* Default to yydebug support */
 #endif
 
+#define YYFPRINTF parser_fprintf
+
 int yyparse (void);
 
 static int yylex (void);
index bc81f221b52aacdf686b89d56faaa69e811d62b6..c5de0af33346a8a9e6af646c54f28021dbcb8841 100644 (file)
@@ -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)
 {
index 7db1c77e1232057e181619a1680fdce18d1989bc..062c34d54a3b9bde2b37c746de715051b431ae7b 100644 (file)
@@ -216,4 +216,9 @@ struct op_print
 
 extern int target_map_name_to_register (char *, int);
 
+/* Function used to avoid direct calls to fprintf
+   in the code generated by the bison parser.  */
+
+extern void parser_fprintf (FILE *, const char *, ...) ATTR_FORMAT (printf, 2 ,3);
+
 #endif /* PARSER_DEFS_H */