dwarf_loader: Print the hexadecimal value for unexpected tags in die__process()

So that we can get it from user reports, i.e. instead of:

  die__process: DW_TAG_compile_unit, DW_TAG_type_unit or DW_TAG_partial_unit expected got INVALID

We now get:

  die__process: DW_TAG_compile_unit, DW_TAG_type_unit or DW_TAG_partial_unit expected got INVALID (0x4a)

That we can then look in dwarf.h and notice that there is this new:

     DW_TAG_skeleton_unit = 0x4a,

Now lets go support it...

Reported-by: https://twitter.com/trass3r
Link: https://github.com/acmel/dwarves/issues/23
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2021-11-12 15:02:28 -03:00
parent ec62499774
commit 7af9ed4aed
1 changed files with 2 additions and 2 deletions

View File

@ -2413,8 +2413,8 @@ static int die__process(Dwarf_Die *die, struct cu *cu, struct conf_load *conf)
}
if (tag != DW_TAG_compile_unit && tag != DW_TAG_type_unit) {
fprintf(stderr, "%s: DW_TAG_compile_unit, DW_TAG_type_unit or DW_TAG_partial_unit expected got %s!\n",
__FUNCTION__, dwarf_tag_name(tag));
fprintf(stderr, "%s: DW_TAG_compile_unit, DW_TAG_type_unit or DW_TAG_partial_unit expected got %s (0x%x)!\n",
__FUNCTION__, dwarf_tag_name(tag), tag);
return -EINVAL;
}