This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Automatic cast off "union tree" in gdb
- From: Tom Tromey <tromey at redhat dot com>
- To: "k e" <eiselekd at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 30 Sep 2007 07:00:48 -0600
- Subject: Re: Automatic cast off "union tree" in gdb
- References: <e8611b790709300403i4c08d23fn4e2293a90cb0af35@mail.gmail.com>
- Reply-to: tromey at redhat dot com
>>>>> "Konrad" == k e <eiselekd@gmail.com> writes:
Konrad> Hi, When stepping through gcc with gdb: is there a way
Konrad> to be able to make gdb automatically cast a "union tree" to the
Konrad> correct struct depending on the union tree's type?
Not that I know of.
Konrad> A "p <tree>"
Konrad> will print out all unions. I'd not want to do a cast all the time.
I think most developers use debug_tree for this. There are some gdb
convenience commands defined in gcc/gdbinit.in (which is made into a
real .gdbinit during the build) -- use these. And, I recommend
reading the debugging tips page on the wiki.
Tom