fix: deal with null entries in DIE
This commit is contained in:
parent
22a7fd432b
commit
f172181aaa
1 changed files with 4 additions and 1 deletions
5
main.cpp
5
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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue