This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -fdump-translation-unit-xml


On Monday, September 30, 2002, at 12:22 PM, Pop Sébastian wrote:

On Mon, Sep 30, 2002 at 12:06:13PM -0700, Mike Stump wrote:
I do as well.  I've been looking at the current format for a long
while, and for simple little questions, it is ok, however, for things
that take 2 or 3 levels, it seriously breaks down.  The output is time
comsuming to wade through.
Yep, I'd like to have something more flexible to browse the tree...
Why not having a TreeBrowser on the same model as Open64 WHIRL Browser?
That would be nice! Unfortunately, we don't have it.

What we do have is a tree dumper that we use from within
gdb. In fact, at present that's the only way to use it:
there's no command-line interface. (Yes, that ought to
change.)

Here's an example, where I'm dumping out the tree for a
simple C++ class:

(gdb) run
Starting program: /Volumes/Data/work/root/lib/gcc-lib/powerpc-apple-darwin6.0/3.1/cc1plus -fpreprocessed foo.ii -fPIC -quiet -dumpbase foo.cc -version -D__private_extern__=extern -o foo.s
[Switching to process 16445 thread 0xf07]
GNU CPP version 3.1 20020420 (prerelease) (cpplib) (Darwin/PowerPC)
GNU C++ version 3.1 20020420 (prerelease) (powerpc-apple-darwin6.0)
compiled by GNU C version 3.1 20020420 (prerelease).

Breakpoint 1, finish_struct (t=0x0, attributes=0x0) at ../../fearless-kitty/gcc/cp/class.c:5494
5494 const char *saved_filename = input_filename;
(gdb) n
5495 int saved_lineno = lineno;
(gdb) n
5493 {
(gdb) n
5494 const char *saved_filename = input_filename;
(gdb) n
5495 int saved_lineno = lineno;
(gdb) n
5494 const char *saved_filename = input_filename;
(gdb) n
5495 int saved_lineno = lineno;
(gdb) n
5499 unreverse_member_declarations (t);
(gdb) n
5501 cplus_decl_attributes (&t, attributes, (int) ATTR_FLAG_TYPE_IN_PLACE);
(gdb) print t
$1 = 0xfb9850
(gdb) call dmp_tree(t)
record_type:0xfb9850 fields=0xfba4d0 mbrs=0xfb79c0 #parents=0 type-flags=#125 align=8
*this=0xfb98c0 next-variant=0xfba070 ~X() X() my_class
field_decl:0xfba4d0 t=0xf8b3f0 {int} line=8(foo.cc) off-align=1 lang-flags=#3
cntxt=0xfb9850 val_
type_decl:0xfb99a0 (self-reference) t=0xfb9850 {my_class} line=1 nonlcl cntxt=0xfb9850
my_class
tree_vec:0xfb79c0 (mbrs) len=8
function_decl:0xfb9af0 (mbrs:0) t=0xfb9a80 {method_type} line=3 ext pub lang-flags=#3
cntxt=0xfb9850 ctor my_class
parm_decl:0xfb9bd0 t=0xfb9b60 {pointer_type} line=3 arg-type=0xfb9b60 sz=32(4) this

function_decl:0xfb9d20 (mbrs:1) t=0xfb9e70 {method_type} line=4 ext pub virt
lang-flags=#3 cntxt=0xfb9850 dtor my_class
parm_decl:0xfb9d90 t=0xfb9b60 {pointer_type} line=4 arg-type=0xfb9b60 sz=32(4) this
parm_decl:0xfb9e00 t=0xf8b3f0 {int} line=4 arg-type=0xf8b3f0 sz=32(4) __in_chrg

overload:0xfa9a80 (mbrs:2) t=0xfaf1c0 {unknown type} ovld=0xfba3f0 next-ovld=0xfa9a70
val
function_decl:0xfba3f0 (ovld) t=0xfba380 {method_type} line=6 ext pub lang-flags=#3
cntxt=0xfb9850 val
parm_decl:0xfba460 t=0xfb9b60 {pointer_type} line=6 arg-type=0xfb9b60 sz=32(4) this
parm_decl:0xfba2a0 t=0xf8b3f0 {int} line=6 arg-type=0xf8b3f0 sz=32(4) x
overload:0xfa9a70 t=0xfaf1c0 {unknown type} ovld=0xfba000 val
function_decl:0xfba000 (ovld) t=0xfba0e0 {method_type} line=5 ext pub lang-flags=#3
cntxt=0xfb9850 const val
parm_decl:0xfba230 t=0xfba1c0 {pointer_type} line=5 arg-type=0xfba1c0 sz=32(4) this
(gdb)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]