patch: improve decode-to-name of additional DWARF 2/DWARF 3 codes
Gary Funck
gary@intrepid.com
Fri Dec 15 16:04:00 GMT 2006
[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.
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".
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.
ChangeLog:
* dwarf2read.c (dwarf_attr_name, dwarf_cfi_name)
(dwarf_stack_op_name, dwarf_tag_name)
(dwarf_type_encoding_name): Decode additional DWARF 2
and DWARF 3 codes into their corresponding string names.
Diffs attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: improve-decode-to-name-dwarf2read.c.patch
Type: application/octet-stream
Size: 9427 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20061215/467b88b2/attachment.obj>
More information about the Gdb-patches
mailing list