wr_error (where)
<< "invalid or unknown name " << pri::hex (attrib_name)
<< '.' << std::endl;
- failed = true;
+ // libdw should handle unknown attribute, as long as
+ // the form is kosher.
continue;
}
if (!inserted.second)
{
wr_error (where)
- << "duplicate attribute " << pri::attr (attrib_name)
+ << "duplicate attribute " << *attribute
<< " (first was at " << pri::hex (inserted.first->second)
<< ")." << std::endl;
// I think we may allow such files for high-level
if (!cur->has_children)
wr_message (where,
cat (mc_die_rel, mc_acc_bloat, mc_impact_1))
- << "excessive DW_AT_sibling attribute at childless abbrev."
+ << "superfluous DW_AT_sibling attribute at childless abbrev."
<< std::endl;
}
if (attrib_name == DW_AT_ranges)
attribute const *attribute = ver->get_attribute (it->name);
int form_name = it->form;
form const *form = ver->get_form (form_name);
- if (ver->form_class (form, attribute) == cl_indirect)
+ if (attribute != NULL
+ && ver->form_class (form, attribute) == cl_indirect)
{
uint64_t value;
if (!read_sc_value (&value, form->width (cu), ctx, &where))
return -1;
}
- dw_class cls = ver->form_class (form, attribute);
+ dw_class cls = attribute != NULL
+ ? ver->form_class (form, attribute)
+ : max_dw_class;
if (cls == cl_indirect)
{
wr_error (&where, ": indirect form is again indirect.\n");
relocation was made against. */
GElf_Sym **symbolp = NULL;
- assert (form);
- assert (attribute);
-
static dw_class_set ref_classes
(cl_reference, cl_loclistptr, cl_lineptr, cl_macptr,
cl_rangelistptr);
- if (ref_classes.test (cls))
+ if (cls != max_dw_class && ref_classes.test (cls))
if (form->width (cu) == fw_8
&& cu->head->offset_size == 4)
wr_error (where)
// error the second time now.
wr_error (where)
<< "can't read value of attribute "
- << *attribute << '.' << std::endl;
+ << pri::attr (it->name) << '.' << std::endl;
return -1;
}
if (storclass == sc_block)
<< "unexpected relocation of " << pri::form (form_name)
<< '.' << std::endl;
- form_width_t width = form->width (cu);
- relocate_one (&file, reloc, rel, width, &value, &where,
- reloc_target (form, attribute), symbolp);
+ if (attribute != NULL)
+ {
+ form_width_t width = form->width (cu);
+ relocate_one (&file, reloc, rel, width, &value, &where,
+ reloc_target (form, attribute), symbolp);
+ }
if (relocatedp != NULL)
*relocatedp = true;
testfiles libdl-2.12.so.debug
-# Here we test that the user gets all the citations in .debug_abbrev,
-# and that dwarflint doesn't bail out on first failure.
+# Here we test that dwarflint can tolerate invalid attribute name.
testrun_compare ./dwarflint --check=@low --nognu libdl-2.12.so.debug <<EOF
error: .debug_abbrev: abbr. attribute 0xbe: invalid or unknown name 0x2107.
error: .debug_abbrev: abbr. attribute 0x330: invalid or unknown name 0x2107.
error: .debug_abbrev: abbr. attribute 0xa28: invalid or unknown name 0x2107.
error: .debug_abbrev: abbr. attribute 0x108e: invalid or unknown name 0x2107.
error: .debug_abbrev: abbr. attribute 0x1300: invalid or unknown name 0x2107.
+error: .debug_line: table 4508: sequence of opcodes not terminated with DW_LNE_end_sequence.
+error: .debug_line: table 4606: sequence of opcodes not terminated with DW_LNE_end_sequence.
EOF
# Here we test proper support for DW_AT_GNU_vector