aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/dump-parse-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/dump-parse-tree.c')
-rw-r--r--gcc/fortran/dump-parse-tree.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c
index f798ed0..7a74c31 100644
--- a/gcc/fortran/dump-parse-tree.c
+++ b/gcc/fortran/dump-parse-tree.c
@@ -50,10 +50,26 @@ static void show_namespace (gfc_namespace *ns);
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 @@ void debug (gfc_typespec ts)
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)
{