diff --git a/main.cpp b/main.cpp index 6dd1732..5628667 100644 --- a/main.cpp +++ b/main.cpp @@ -175,7 +175,7 @@ void parse_debuginfo_section(const void *file) attr_specs.push_back({attrib_name, attrib_form, implicit_const}); } } while (attrib_name && attrib_form); - abbrev_table.specs.push_back(attr_specs); + abbrev_table.specs.push_back(attr_specs); } while (true); p += sizeof(compilation_unit_header_t); @@ -189,6 +189,9 @@ void parse_debuginfo_section(const void *file) { p += decode_leb128((uint8_t*)p, &code); + if (!code) // null entry, skip and continue as normal + continue; + fprintf(stdout, "%d (%s)\n", code, dwarf_get_TAG_name(abbrev_table.entries[code-1].abbrev_tag)); for (size_t i = 0; i < abbrev_table.specs[code-1].size(); ++i) {