[dwarflint] asserts with check_debug_info

Mark Wielaard mjw at redhat.com
Fri Apr 8 20:13:52 UTC 2011


Hi Petr,

check_debug_info can trigger an assert, which isn't a really nice way to
report an unexpected form for an attribute in the abbrev. The issue is
that read_die_chain () calls dwarf_version::form_class () a couple of
times without first validating the form via form_allowed (). Which is
understandable because this is a low level check and form_allowed () for
higher level checks to use. But... form_class will assert () if the form
isn't allowed/expected. This produces hard the debug "error reports"
when an attribute is encountered in an unforeseen form.

I fixed it by letting form_class () return max_dw_class, like
ambiguous_class () does. max_dw_class is already used as sentinel in
read_die_chain () in case the attribute is unknown. This lets things
work out for the low level check_debug_info check and then makes the
higher-level checks complain about the unexpected form instead.

Does this (patch attached) look like a sane solution to you?

Thanks,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: form_class.patch
Type: text/x-patch
Size: 820 bytes
Desc: not available
Url : https://fedorahosted.org/pipermail/elfutils-devel/attachments/20110408/c5bc8b3d/attachment.bin 


More information about the elfutils-devel mailing list