From patchwork Mon Sep 6 17:46:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Fortran] PR 45560 - add EXPR pretty printer (gfc_debug_expr) Date: Mon, 06 Sep 2010 07:46:58 -0000 From: Tobias Burnus X-Patchwork-Id: 63949 Message-Id: <4C852912.3080505@net-b.de> To: gcc patches , gfortran 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 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