for (std::vector<cu>::iterator it = _m_info->cus.begin ();
it != _m_info->cus.end (); ++it)
{
- if (it->stmt_list.addr != (uint64_t)-1
- && (_m_line == NULL
- || !_m_line->has_line_table (it->stmt_list.addr)))
+ if (it->stmt_list.addr == (uint64_t)-1)
+ for (size_t i = 0; i < it->decl_file_refs.size; ++i)
+ wr_error (it->decl_file_refs.refs[i].who)
+ << "references .debug_line table, but CU DIE lacks DW_AT_stmt_list."
+ << std::endl;
+ else if (_m_line == NULL
+ || !_m_line->has_line_table (it->stmt_list.addr))
wr_error (it->stmt_list.who)
<< "unresolved reference to .debug_line table "
<< pri::hex (it->stmt_list.addr) << '.' << std::endl;
srcdir=$srcdir/tests
-testfiles hello.bad-1 hello.bad-3 garbage-1 garbage-2 garbage-3 garbage-4 \
+testfiles hello.bad-1 hello.bad-3 empty-1 \
+ garbage-1 garbage-2 garbage-3 garbage-4 \
garbage-5 garbage-6 garbage-7 garbage-8
testrun_compare ./dwarflint hello.bad-1 <<EOF
error: .debug_info: DIE 0xab: toplevel DIE chain contains more than one DIE.
EOF
+testrun_compare ./dwarflint empty-1 <<EOF
+warning: .debug_line: table 0: the file #1 \`empty.c' is not used.
+error: .debug_line: table 0: sequence of opcodes not terminated with DW_LNE_end_sequence.
+error: .debug_info: DIE 0x29 (abbr. attribute 0x13): references .debug_line table, but CU DIE lacks DW_AT_stmt_list.
+EOF
+
testrun_compare ./dwarflint garbage-1 <<EOF
error: Broken ELF: offset out of range.
error: .debug_abbrev: data not found.