Message ID | 4C852912.3080505@net-b.de |
---|---|
State | New |
Headers | show |
Tobias Burnus wrote: > 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. I remember a discussion some time ago about this topic, where the argument "against" implementing something like that was that this is just what dump-parse-tree can do. But it seems your patch is just to ease this usage. > Build on x86-64-linux. > OK for the trunk? Ok. Thanks! Daniel
On Mon, Sep 6, 2010 at 10:46 AM, Tobias Burnus <burnus@net-b.de> wrote: > 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. I would use stderr instead of stdout. It is also not buffered. The GCC debug_* functions all use stderr. Thanks, Andrew Pinski
Andrew Pinski wrote: > On Mon, Sep 6, 2010 at 10:46 AM, Tobias Burnus<burnus@net-b.de> wrote: >> 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. > I would use stderr instead of stdout. It is also not buffered. > The GCC debug_* functions all use stderr. I concur - and have commit a fix as Rev. 163931. 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