[RFC] Fortran-intern "tree browser"

Tobias Schlüter Tobias.Schlueter@physik.uni-muenchen.de
Wed Sep 3 15:16:00 GMT 2008


Hi Daniel,

Daniel Kraft wrote:
> I'm just in the middle of a debugging-session for PR 37099, and find it 
> somewhat tedious to analyse the gfortran-internal trees (mostly 
> gfc_expr) via gdb's print dump.  Especially wide-character strings and 
> things like gmp-constants are quite hard to figure out by hand...

It should be possible to call gfc_show_expr() and the like from the 
debugger.  At least I put a patch into the tree for exactly this 
purpose.  This should address most of your ideas.

Cheers,
- Tobi

> What do you think about implementing something like GIMPLE's 
> "browse_tree" functionality?  A global function, that can be called 
> right away from gdb's prompt and handed in a gfc_code/gfc_expr (or 
> however we want it), and that helps in analysing it?  This could be 
> interactive as browse_tree is (although I'm not sure this is necessary) 
> or at the very simplest case just use the routines from 
> dump-parse-tree.c to dump the expression readable to stdout.
> 
> But maybe some other format, or an extended mode for dump-parse-tree, 
> could be useful, too.  For my current session, I've spent a lot of time 
> looking at string-lengths in typespecs.  I think for debugging-output, 
> the type-spec in some form should be available, too...  But that's just 
> an idea.
> 
> What do you think about this idea in general?  Or is there already 
> something one can use for this purpose?  I'd like to hear your opinions 
> on how this should be done and what features you would expect.  If you 
> like the idea, I'm volunteering to work something out for proposing ;) 
> BTW, would such a change have problems getting into stage3?  But if it 
> is something not visible to ordinary users but only from the debugger, 
> it should not cause any risks, of course.
> 
> Yours,
> Daniel
> 


-- 
Tobias Schlüter
Am Coulombwall 1, Zi. 326
85748 Garching b. München
Tel.: +49/89/289-14139



More information about the Fortran mailing list