fix: deal with null entries in DIE

This commit is contained in:
Phireh 2023-09-24 17:15:38 +02:00
commit f172181aaa
Signed by: Phireh
GPG key ID: DD169F1BA658A5E5

View file

@ -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)
{