aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-09-29 18:49:08 -0600
committerTom Tromey <tom@tromey.com>2020-09-29 20:29:06 -0600
commit6c412691f9a2c9adaa3fdd057dcad6dcd68f13ec (patch)
tree81cc4b23f8a9f97b09fc4f39fdf295f911a183d8 /gdb
parent95f982e587ddd0bf9a4799853982e7cc726280ad (diff)
downloadgdb-6c412691f9a2c9adaa3fdd057dcad6dcd68f13ec.zip
gdb-6c412691f9a2c9adaa3fdd057dcad6dcd68f13ec.tar.gz
gdb-6c412691f9a2c9adaa3fdd057dcad6dcd68f13ec.tar.bz2
Avoid using DW_* macros in dwarf2/attribute.c
There's no need to use the DW_* accessor macros in dwarf2/attribute.c, and this is a necessary step toward our goal of removing them entirely. gdb/ChangeLog 2020-09-29 Tom Tromey <tom@tromey.com> * dwarf2/attribute.c (attribute::address): Don't use DW_UNSND or DW_ADDR. (attribute::string): Don't use DW_STRING. (attribute::get_ref_die_offset): Don't use DW_UNSND. (attribute::constant_value): Don't use DW_UNSND or DW_SND.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/dwarf2/attribute.c10
2 files changed, 13 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b561f8a..b78cffe 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2020-09-29 Tom Tromey <tom@tromey.com>
+ * dwarf2/attribute.c (attribute::address): Don't use DW_UNSND or
+ DW_ADDR.
+ (attribute::string): Don't use DW_STRING.
+ (attribute::get_ref_die_offset): Don't use DW_UNSND.
+ (attribute::constant_value): Don't use DW_UNSND or DW_SND.
+
+2020-09-29 Tom Tromey <tom@tromey.com>
+
* dwarf2/read.c (dwarf2_find_base_address, read_call_site_scope)
(dwarf2_get_pc_bounds, dwarf2_record_block_ranges)
(partial_die_info::read, dwarf2_string_attr, new_symbol): Update.
diff --git a/gdb/dwarf2/attribute.c b/gdb/dwarf2/attribute.c
index 1345e0a..af24d66 100644
--- a/gdb/dwarf2/attribute.c
+++ b/gdb/dwarf2/attribute.c
@@ -51,10 +51,10 @@ attribute::as_address () const
as well as update callers to pass in at least the CU's DWARF
version. This is more overhead than what we're willing to
expand for a pretty rare case. */
- addr = DW_UNSND (this);
+ addr = u.unsnd;
}
else
- addr = DW_ADDR (this);
+ addr = u.addr;
return addr;
}
@@ -73,7 +73,7 @@ attribute::as_string () const
|| form == DW_FORM_strx4
|| form == DW_FORM_GNU_str_index
|| form == DW_FORM_GNU_strp_alt)
- return DW_STRING (this);
+ return u.str;
return nullptr;
}
@@ -135,13 +135,13 @@ LONGEST
attribute::constant_value (int default_value) const
{
if (form == DW_FORM_sdata || form == DW_FORM_implicit_const)
- return DW_SND (this);
+ return u.snd;
else if (form == DW_FORM_udata
|| form == DW_FORM_data1
|| form == DW_FORM_data2
|| form == DW_FORM_data4
|| form == DW_FORM_data8)
- return DW_UNSND (this);
+ return u.unsnd;
else
{
/* For DW_FORM_data16 see attribute::form_is_constant. */