diff options
author | Tom Tromey <tom@tromey.com> | 2020-09-29 18:49:08 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-09-29 20:29:06 -0600 |
commit | 630ed6b975d2d2f950523dd2ad9ac77614f5222c (patch) | |
tree | 1d3434e503cc0f281807ffe8a379e2163409225d /gdb/dwarf2/attribute.h | |
parent | 9d2246fce014a0133882051f8527e2dbd869a31b (diff) | |
download | gdb-630ed6b975d2d2f950523dd2ad9ac77614f5222c.zip gdb-630ed6b975d2d2f950523dd2ad9ac77614f5222c.tar.gz gdb-630ed6b975d2d2f950523dd2ad9ac77614f5222c.tar.bz2 |
Remove DW_SIGNATURE
This removes DW_SIGNATURE in favor of methods on struct attribute. As
usual, the methods check the form, which DW_SIGNATURE did not do.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (read_attribute_value, lookup_die_type)
(dump_die_shallow, follow_die_sig, get_DW_AT_signature_type):
Update.
* dwarf2/attribute.h (struct attribute) <as_signature,
set_signature>: New methods.
(DW_SIGNATURE): Remove.
Diffstat (limited to 'gdb/dwarf2/attribute.h')
-rw-r--r-- | gdb/dwarf2/attribute.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/dwarf2/attribute.h b/gdb/dwarf2/attribute.h index 0e2e86d..800ea8d 100644 --- a/gdb/dwarf2/attribute.h +++ b/gdb/dwarf2/attribute.h @@ -57,6 +57,14 @@ struct attribute return u.blk; } + /* Return the signature. The attribute must have signature + form. */ + ULONGEST as_signature () const + { + gdb_assert (form == DW_FORM_ref_sig8); + return u.signature; + } + /* Return non-zero if ATTR's value is a section offset --- classes lineptr, loclistptr, macptr or rangelistptr --- or zero, otherwise. You may use DW_UNSND (attr) to retrieve such offsets. @@ -160,6 +168,13 @@ struct attribute u.blk = blk; } + /* Set the signature value for this attribute. */ + void set_signature (ULONGEST signature) + { + gdb_assert (form == DW_FORM_ref_sig8); + u.signature = signature; + } + ENUM_BITFIELD(dwarf_attribute) name : 16; ENUM_BITFIELD(dwarf_form) form : 15; @@ -192,6 +207,5 @@ private: #define DW_UNSND(attr) ((attr)->u.unsnd) #define DW_SND(attr) ((attr)->u.snd) #define DW_ADDR(attr) ((attr)->u.addr) -#define DW_SIGNATURE(attr) ((attr)->u.signature) #endif /* GDB_DWARF2_ATTRIBUTE_H */ |