Handle DW_FORM_implicit_const when displaying an attribute

Message ID 20210618202130.3618097-1-tom@tromey.com
State New
Headers show
Series
  • Handle DW_FORM_implicit_const when displaying an attribute
Related show

Commit Message

Tom Tromey June 18, 2021, 8:21 p.m.
On an executable I have, "readelf -wi" shows:

 <1><63>: Abbrev Number: 2 (DW_TAG_base_type)
    <64>   DW_AT_byte_size   : 4
    <65>   DW_AT_encoding    : 4	(void)
    <65>   DW_AT_name        : f32

Here, DW_AT_encoding reports "4", but shows the name as "void" -- but
it should be "float".

I tracked this down to a missing case in read_and_display_attr_value.

2021-06-18  Tom Tromey  <tom@tromey.com>

	* dwarf.c (read_and_display_attr_value): Handle
	DW_FORM_implicit_const.
---
 binutils/ChangeLog | 5 +++++
 binutils/dwarf.c   | 4 ++++
 2 files changed, 9 insertions(+)

-- 
2.26.3

Comments

Mike Frysinger via Binutils June 30, 2021, 3:19 p.m. | #1
Hi Tom,

> 	* dwarf.c (read_and_display_attr_value): Handle

> 	DW_FORM_implicit_const.


Approved and applied.  (Sorry for the delay - I am way behind in my patch review).

Cheers
   Nick
Tom Tromey June 30, 2021, 4:11 p.m. | #2
>>>>> "Nick" == Nick Clifton <nickc@redhat.com> writes:


Nick> Hi Tom,
>> * dwarf.c (read_and_display_attr_value): Handle

>> DW_FORM_implicit_const.


Nick> Approved and applied.  (Sorry for the delay - I am way behind in my patch review).

You may wish to use "git am" or commit with --author, to set the author correctly.
Or, you can just let me check in approved patches.

thanks,
Tom

Patch

diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index ebc7b023e3b..530fa537536 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -2517,6 +2517,10 @@  read_and_display_attr_value (unsigned long           attribute,
 					  offset_size, dwarf_version,
 					  debug_info_p, do_loc,
 					  section, this_set, delimiter, level);
+
+    case DW_FORM_implicit_const:
+      uvalue = implicit_const;
+      break;
     }
 
   switch (form)