This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch,Fortran] PR 45560 - add EXPR pretty printer (gfc_debug_expr)


Richard stated in #gcc that he misses a pretty printer for gfc_expr. The attached patch adds one. To be used in the debugger - otherwise, the function is not called.

Build on x86-64-linux.
OK for the trunk?

Tobias
2010-09-06  Tobias Burnus  <burnus@net-b.de>

	PR fortran/45560
	* dump-parse-tree.c (gfc_debug_expr): New function.

Index: gcc/fortran/dump-parse-tree.c
===================================================================
--- gcc/fortran/dump-parse-tree.c	(Revision 163924)
+++ gcc/fortran/dump-parse-tree.c	(Arbeitskopie)
@@ -49,6 +49,20 @@
 static void show_namespace (gfc_namespace *ns);
 
 
+/* Allow dumping of an expression in the debugger.  */
+void gfc_debug_expr (gfc_expr *);
+
+void
+gfc_debug_expr (gfc_expr *e)
+{
+  FILE *tmp = dumpfile;
+  dumpfile = stdout;
+  show_expr (e);
+  fputc ('\n', dumpfile);
+  dumpfile = tmp;
+}
+
+
 /* Do indentation for a specific level.  */
 
 static inline void

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]