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:07 -0600 |
commit | 23dca5c3d77252ad8000d749b4457f7e286b8367 (patch) | |
tree | 72773528073caf42d22c15e61fb9f0452857fa3c /gdb/dwarf2/read.c | |
parent | 52c14d112840423f0515f7334063f532ec3950b1 (diff) | |
download | binutils-23dca5c3d77252ad8000d749b4457f7e286b8367.zip binutils-23dca5c3d77252ad8000d749b4457f7e286b8367.tar.gz binutils-23dca5c3d77252ad8000d749b4457f7e286b8367.tar.bz2 |
Add attribute::as_virtuality method
This adds a new attribute::as_virtuality method and changes the DWARF
reader to use it. This also ensures that the attibute's form will now
be respected.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (dwarf2_add_field, dwarf2_add_member_fn): Update.
* dwarf2/attribute.h (struct attribute) <as_virtuality>: New
method.
* dwarf2/attribute.c (attribute::as_virtuality): New method.
Diffstat (limited to 'gdb/dwarf2/read.c')
-rw-r--r-- | gdb/dwarf2/read.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 86a7918..6653aee 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -15021,7 +15021,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, attr = dwarf2_attr (die, DW_AT_virtuality, cu); if (attr != nullptr) - new_field->virtuality = DW_UNSND (attr); + new_field->virtuality = attr->as_virtuality (); else new_field->virtuality = DW_VIRTUALITY_none; @@ -15722,7 +15722,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, else { attr = dwarf2_attr (die, DW_AT_virtuality, cu); - if (attr && DW_UNSND (attr)) + if (attr != nullptr && attr->as_virtuality () != DW_VIRTUALITY_none) { /* GCC does this, as of 2008-08-25; PR debug/37237. */ complaint (_("Member function \"%s\" (offset %s) is virtual " |