summaryrefslogtreecommitdiff
path: root/libiberty/dwarfnames.c
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-09-23 16:10:41 +0200
committerMark Wielaard <mark@klomp.org>2020-09-24 22:37:10 +0200
commit942ab9e9d4ff1da711daad3e8c71c57fd4c14035 (patch)
tree074b240025069ca94d348c485cd06febacfda598 /libiberty/dwarfnames.c
parentd13c0ae859fbb5bb937692548e5860e4cb39e26b (diff)
libiberty: Add get_DW_UT_name and update include/dwarf2.{def,h}
This adds a get_DW_UT_name function to dwarfnames using dwarf2.def for use in binutils readelf to show the unit types in a DWARF5 header. Also remove DW_CIE_VERSION which was already removed in binutils/gdb and is not used in gcc. include/ChangeLog: * dwarf2.def: Add DWARF5 Unit type header encoding macros DW_UT_FIRST, DW_UT and DW_UT_END. * dwarf2.h (enum dwarf_unit_type): Removed and define using DW_UT_FIRST, DW_UT and DW_UT_END macros. (DW_CIE_VERSION): Removed. (get_DW_UT_name): New function declaration. libiberty/ChangeLog: * dwarfnames.c (get_DW_UT_name): Define using DW_UT_FIRST, DW_UT and DW_UT_END.
Diffstat (limited to 'libiberty/dwarfnames.c')
-rw-r--r--libiberty/dwarfnames.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libiberty/dwarfnames.c b/libiberty/dwarfnames.c
index 968d1917532..af11668b431 100644
--- a/libiberty/dwarfnames.c
+++ b/libiberty/dwarfnames.c
@@ -64,6 +64,11 @@ Boston, MA 02110-1301, USA. */
switch (idx) { \
DW_IDX (name, value)
#define DW_END_IDX } return 0; }
+#define DW_FIRST_UT(name, value) \
+ const char *get_DW_UT_name (unsigned int ut) { \
+ switch (ut) { \
+ DW_UT (name, value)
+#define DW_END_UT } return 0; }
#define DW_TAG(name, value) case name: return # name ;
#define DW_TAG_DUP(name, value)
@@ -78,6 +83,7 @@ Boston, MA 02110-1301, USA. */
#define DW_CFA_DUP(name, value)
#define DW_IDX(name, value) case name: return # name ;
#define DW_IDX_DUP(name, value)
+#define DW_UT(name, value) case name: return # name ;
#include "dwarf2.def"
@@ -95,6 +101,7 @@ Boston, MA 02110-1301, USA. */
#undef DW_END_CFA
#undef DW_FIRST_IDX
#undef DW_END_IDX
+#undef DW_END_UT
#undef DW_TAG
#undef DW_TAG_DUP