This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [RFC] Fortran-intern "tree browser"
Tobias Schlüter wrote:
Steve Kargl wrote:
On Wed, Sep 03, 2008 at 05:16:00PM +0200, Tobias Schl?ter wrote:
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.
It appears someone (un)fixed your changed.
mobile:kargl[214] grep gfc_show_expr *c
mobile:kargl[215] grep -2 -E ^show_expr *c
dump-parse-tree.c-
dump-parse-tree.c-static void
dump-parse-tree.c:show_expr (gfc_expr *p)
dump-parse-tree.c-{
A cursory search didn't review where those function were made
non-static. (For the historically interested: originally these
functions were spread out over the various source files as a sort of
documentation, during the move into gcc's tree Steven collected them
into dump-parse-tree.c and made them static, I made them non-static
again, FX reverted this change, probably there are a few more iterations
to come unless we add a comment why they're static or not.)
What's about creating a new method for the dedicated purpose of being
called from the debugger, like gfc_debug_expr/gfc_debug_code (or _dump_
if you like better), that at the moment simply calls through to
show_expr (being static or public, does not matter)? Besides "fixing"
this static/public problem, this leaves potential for future changes to
dumping for debugging-only (like printing more details if requested or
something similar).
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