From cda1196d5d8b0e40013c9012967dbba7e8549f78 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 25 Feb 2011 13:04:21 +0100 Subject: Merge over dwarf string fixes from readelf master to dwarfstrings. * src/dwarfstrings.c (dwarf_tag_string): Add type_unit, rvalue_reference_type and template_alias. (dwarf_tag_string): Add GNU_* tags. (dwarf_attr_string): Add signature, main_subprogram, const_expr and enum_class. --- src/dwarfstrings.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/dwarfstrings.c b/src/dwarfstrings.c index b340f026..3909e131 100644 --- a/src/dwarfstrings.c +++ b/src/dwarfstrings.c @@ -97,6 +97,9 @@ dwarf_tag_string (unsigned int tag) [DW_TAG_mutable_type] = "mutable_type", [DW_TAG_condition] = "condition", [DW_TAG_shared_type] = "shared_type", + [DW_TAG_type_unit] = "type_unit", + [DW_TAG_rvalue_reference_type] = "rvalue_reference_type", + [DW_TAG_template_alias] = "template_alias", }; const unsigned int nknown_tags = (sizeof (known_tags) / sizeof (known_tags[0])); @@ -126,6 +129,26 @@ dwarf_tag_string (unsigned int tag) result = "class_template"; break; + case DW_TAG_GNU_BINCL: + result = "GNU_BINCL"; + break; + + case DW_TAG_GNU_EINCL: + result = "GNU_EINCL"; + break; + + case DW_TAG_GNU_template_template_param: + result = "GNU_template_template_param"; + break; + + case DW_TAG_GNU_template_parameter_pack: + result = "GNU_template_parameter_pack"; + break; + + case DW_TAG_GNU_formal_parameter_pack: + result = "GNU_formal_parameter_pack"; + break; + default: if (tag < DW_TAG_lo_user) snprintf (buf, sizeof buf, gettext ("unknown tag %hx"), tag); @@ -233,6 +256,11 @@ dwarf_attr_string (unsigned int attrnum) [DW_AT_elemental] = "elemental", [DW_AT_pure] = "pure", [DW_AT_recursive] = "recursive", + [DW_AT_signature] = "signature", + [DW_AT_main_subprogram] = "main_subprogram", + [DW_AT_data_bit_offset] = "data_bit_offset", + [DW_AT_const_expr] = "const_expr", + [DW_AT_enum_class] = "enum_class", [DW_AT_linkage_name] = "linkage_name", }; const unsigned int nknown_attrs = (sizeof (known_attrs) -- cgit v1.2.1 From 25f3fc402dd643ae8b269c76afc842e3d2765633 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 25 Feb 2011 13:45:14 +0100 Subject: Don't use dwarf_tag_string, but dwarf::tags::name for dwarf_edit_output test. --- tests/Makefile.am | 3 +-- tests/dwarf_edit_output.cc | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a33e0521..641bce2e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -214,8 +214,7 @@ dwarf_print_LDADD = $(libdwpp) $(libmudflap) -ldl dwarf_edit_SOURCES = dwarf_edit.cc print-die.cc dwarf_edit_LDADD = $(libdwpp) $(libmudflap) -ldl -dwarf_edit_output_SOURCES = dwarf_edit_output.cc print-die.cc \ - ../src/dwarfstrings.c +dwarf_edit_output_SOURCES = dwarf_edit_output.cc print-die.cc dwarf_edit_output_LDADD = $(libdwpp) $(libmudflap) -ldl arextract_LDADD = $(libelf) $(libmudflap) diff --git a/tests/dwarf_edit_output.cc b/tests/dwarf_edit_output.cc index b1483d19..7e3def94 100644 --- a/tests/dwarf_edit_output.cc +++ b/tests/dwarf_edit_output.cc @@ -37,8 +37,6 @@ #include "c++/subr.hh" -#include "../src/dwarfstrings.h" - using namespace elfutils; using namespace std; @@ -520,7 +518,7 @@ test_last_two_dies (dwarf_edit &in, dwarf_output &out, int tag, bool same, cmp compare; if (compare.compare_dies (*die1, *die2, in) != same) error (-1, 0, "dwarf_comparator fail %s test #%d '%s'", - dwarf_tag_string (tag), n, name); + dwarf::tags::name (tag).c_str (), n, name); } dwarf_output::compile_units_type::const_iterator cu; @@ -537,7 +535,7 @@ test_last_two_dies (dwarf_edit &in, dwarf_output &out, int tag, bool same, it++; } if (show_output) - cout << "offset last (" << dwarf_tag_string (tag) << ") cu1: " + cout << "offset last (" << dwarf::tags::name (tag) << ") cu1: " << hex << off1 << endl; cu++; @@ -549,14 +547,14 @@ test_last_two_dies (dwarf_edit &in, dwarf_output &out, int tag, bool same, it++; } if (show_output) - cout << "offset last (" << dwarf_tag_string (tag) << ") cu2: " + cout << "offset last (" << dwarf::tags::name (tag) << ") cu2: " << hex << off2 << endl; bool both_zero = off1 == 0 && off2 == 0; bool equal = off1 == off2; if (! both_zero && equal != same) error (-1, 0, "dwarf_comparator fail %s test #%d '%s'", - dwarf_tag_string (tag), n, name); + dwarf::tags::name (tag).c_str (), n, name); } -- cgit v1.2.1 From b0ce9efa2135e22cc7fdb3e796522817788bb53b Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 23 Feb 2011 23:06:20 +0100 Subject: tests/run-dwarfcmp-self.sh dwarflint is in its own directory now. --- tests/run-dwarfcmp-self.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run-dwarfcmp-self.sh b/tests/run-dwarfcmp-self.sh index efc14047..02bf4be4 100755 --- a/tests/run-dwarfcmp-self.sh +++ b/tests/run-dwarfcmp-self.sh @@ -62,7 +62,7 @@ runtest ../src/unstrip runtest ../*/*.so # These are the biggest ones. -runtest ../src/dwarflint +runtest ../dwarflint/dwarflint runtest ../src/dwarfcmp runtest ../src/dwarfcmp-test -- cgit v1.2.1