[RFC] Fortran-intern "tree browser"

Daniel Kraft d@domob.eu
Wed Sep 3 15:12:00 GMT 2008


Hi,

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...

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

-- 
Done:     Arc-Bar-Cav-Sam-Val-Wiz, Dwa-Elf-Gno-Hum-Orc, Law-Neu-Cha, Fem-Mal
To go:    Hea-Kni-Mon-Pri-Ran-Rog-Tou



More information about the Fortran mailing list