Bug 21792 - Decode DWARF5 in eu-readelf
Summary: Decode DWARF5 in eu-readelf
Status: RESOLVED FIXED
Alias: None
Product: elfutils
Classification: Unclassified
Component: tools (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-19 17:54 UTC by Ben Woodard
Modified: 2017-09-20 18:38 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
clang compiled object that includes the example above (10.28 KB, application/x-object)
2017-07-19 17:54 UTC, Ben Woodard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Woodard 2017-07-19 17:54:37 UTC
Created attachment 10274 [details]
clang compiled object that includes the example above

We are starting to use Clang 4.0.0 at LLNL and it is emitting some DWARF5 opcodes. Please add DWARF5 decoding to eu-readelf.

For example:
#include <string>
#include <vector>

std::vector<std::string> var;

and tangentially I saw something in the DWARF which neither readelf or eu-readelf understands.
[   7e1]      namespace
               name                 (strp) "__cxx11"
               decl_file            (data1) 1
               decl_line            (data2) 2214
               ??? (0x89)           (flag_present) yes


Since clang is already emitting some DWARF5 we should at least be able to decode what it is emitting reliably.
Comment 1 Mark Wielaard 2017-09-20 18:38:15 UTC
Although it isn't full DWARF5 support all DWARF5 tags and attributes are recognized in 0.170. From the NEWS file:

Version 0.170

libdw: Added new DWARF5 attribute, tag, character encoding, language code,
       calling convention, defaulted member function and macro constants
       to dwarf.h.
       New functions dwarf_default_lower_bound and dwarf_line_file.
       dwarf_peel_type now handles DWARF5 immutable, packed and shared tags.
       dwarf_getmacros now handles DWARF5 .debug_macro sections.

And the above example now shows:

 [   7e1]      namespace
               name                 (strp) "__cxx11"
               decl_file            (data1) 1
               decl_line            (data2) 2214
               export_symbols       (flag_present) yes