diff mbox series

[fortran,committed] Add a few more debug functions

Message ID 1cee3a5a-59ee-cfbc-160b-d0ed30081b40@tkoenig.net
State New
Headers show
Series [fortran,committed] Add a few more debug functions | expand

Commit Message

Thomas König March 31, 2019, 3:23 p.m. UTC
Hello world,

I have just committed this patch as obvious to make debugging
a bit easier. No user impact, the code compiles :-)

Regards

	Thomas

2019-03-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* dump-parse-tree.c (debug):  Add for symbol_attribute *,
	symbol_attribute and gfc_ref * arguments.
diff mbox series

Patch

Index: dump-parse-tree.c
===================================================================
--- dump-parse-tree.c	(Revision 269895)
+++ dump-parse-tree.c	(Arbeitskopie)
@@ -50,10 +50,26 @@ 
 static void show_code (int, gfc_code *);
 static void show_symbol (gfc_symbol *);
 static void show_typespec (gfc_typespec *);
+static void show_ref (gfc_ref *);
+static void show_attr (symbol_attribute *, const char *);
 
 /* Allow dumping of an expression in the debugger.  */
 void gfc_debug_expr (gfc_expr *);
 
+void debug (symbol_attribute *attr)
+{
+  FILE *tmp = dumpfile;
+  dumpfile = stderr;
+  show_attr (attr, NULL);
+  fputc ('\n', dumpfile);
+  dumpfile = tmp;
+}
+
+void debug (symbol_attribute attr)
+{
+  debug (&attr);
+}
+
 void debug (gfc_expr *e)
 {
   FILE *tmp = dumpfile;
@@ -79,6 +95,15 @@ 
   debug (&ts);
 }
 
+void debug (gfc_ref *p)
+{
+  FILE *tmp = dumpfile;
+  dumpfile = stderr;
+  show_ref (p);
+  fputc ('\n', dumpfile);
+  dumpfile = tmp;
+}
+
 void
 gfc_debug_expr (gfc_expr *e)
 {