From: Jim Blandy <jimb@codesourcery.com>
To: "Gary Funck" <gary@intrepid.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: patch: improve decode-to-name of additional DWARF 2/DWARF 3 codes
Date: Mon, 18 Dec 2006 21:28:00 -0000 [thread overview]
Message-ID: <m3d56ghp09.fsf@codesourcery.com> (raw)
In-Reply-To: <002501c72062$c61b9a10$0a0a0a0a@DELORIAN> (Gary Funck's message of "Fri, 15 Dec 2006 08:04:59 -0800")
"Gary Funck" <gary@intrepid.com> writes:
> [I'm resubmitting this patch, incorporating Jim Blandy's
> suggestions. I think the copyright assignment issues have
> been straightened out. If not, please let me know off list.]
>
> While debugging GDB, I noticed the routines in dwarf2read.c that
> decode DWARF 2 and DWARF 3 codes into their corresponding string
> names have not been updated to include the various encodings
> that have been added over the past few years. This primarily
> impacts the diagnostic output that assists when debugging GDB.
>
> Attached is a suggested patch (to gdb 6.5), which brings the
> various *_name routines up to date with the definitions
> in include/elf/dwarf2.h.
This looks great; please go ahead and commit. Thanks for all your
patience.
> There is a small problem in the decoding caused by the
> following (in dwarf2.h):
>
> /* GNU extensions. */
> DW_OP_GNU_push_tls_address = 0xe0,
> /* HP extensions. */
> DW_OP_HP_unknown = 0xe0, /* Ouch, the same as GNU_push_tls_address.
> */
>
> I arbitrarily chose to decode 0xe0 as "DW_OP_GNU_push_tls_address".
I think that's the best we can do in these situations.
What's important is that the name decoded actually match how GDB will
interpret it; since GDB recognizes the push_tls_address operation, but
not the 'HP_unknown', that's the way it should print it. If GDB ever
did something fancy like look at the compilation unit's producer and
distinguish opcodes on that basis, then the printer would need to do
the same.
> Also, I preserved the "#ifdef MIPS" inside dwarf_attr_name(), but
> it wasn't clear to me that it is needed. If it is, then for
> consistency, perhaps ifdef's for HP, GNU, DWARF3, and other
> extensions to DWARF 2 would also be required.
If the values don't conflict, I think it's best to go ahead and
recognize all of them. Where they do conflict, the argument above
applies.
next prev parent reply other threads:[~2006-12-18 21:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-15 16:04 Gary Funck
2006-12-18 21:28 ` Jim Blandy [this message]
2006-12-29 19:01 ` [commit] " Gary Funck
2006-12-29 23:16 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3d56ghp09.fsf@codesourcery.com \
--to=jimb@codesourcery.com \
--cc=gary@intrepid.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox