Richard wrote in IRC:
  fortran needs a pretty-printer
  gfc_show_expr is annoying as it doesn't flush and you have to manually set
dumpfile
               to stdout

Untested draft patch:

Index: dump-parse-tree.c
===================================================================
--- dump-parse-tree.c   (revision 163921)
+++ dump-parse-tree.c   (working copy)
@@ -48,6 +48,17 @@
 static void show_code_node (int, gfc_code *);
 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.  */


-- 
           Summary: debugging: Add EXPR pretty printer (gfc_debug_expr)
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45560

Reply via email to