<< " `" << include_directories[i].name
<< "' is not used." << std::endl;
+ // We can't do full analysis unless we know which DIEs refer to
+ // files.
if (_m_info != NULL)
- // We can't do full analysis unless we know which DIEs refer
- // to files.
- for (size_t i = 0; i < files.size (); ++i)
- if (!files[i].used)
- wr_message (where,
- cat (mc_impact_3, mc_acc_bloat, mc_line, mc_header))
- << "the file #" << i + 1
- << " `" << files[i].name << "' is not used." << std::endl;
-
- if (!seen_opcode)
- wr_message (where, cat (mc_line, mc_acc_bloat, mc_impact_3))
- << "empty line number program." << std::endl;
+ {
+ bool useful = false;
+
+ for (size_t i = 0; i < files.size (); ++i)
+ if (!files[i].used)
+ wr_message (where,
+ cat (mc_impact_3, mc_acc_bloat, mc_line, mc_header))
+ << "the file #" << i + 1
+ << " `" << files[i].name << "' is not used." << std::endl;
+ else
+ useful = true;
+
+ if (!seen_opcode && !useful)
+ wr_message (where, cat (mc_line, mc_acc_bloat, mc_impact_3))
+ << "empty line number program and no references from .debug_info."
+ << std::endl;
+ }
struct where wh = WHERE (sec_line, NULL);
- if (!terminated)
+ if (!terminated && seen_opcode)
wr_error (where)
<< "sequence of opcodes not terminated with DW_LNE_end_sequence."
<< std::endl;
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 --strict --check=check_debug_info_refs check_debug_info_refs-2 <<EOF
warning: .debug_info: DIE 0xb (abbreviation 0): DIE chain not terminated with null entry.
warning: .debug_info: DIE 0x54 (abbreviation 48): DIE chain not terminated with null entry.
-warning: .debug_line: table 0: empty line number program.
-error: .debug_line: table 0: sequence of opcodes not terminated with DW_LNE_end_sequence.
warning: .debug_info: CU 0: no aranges table is associated with this CU.
EOF
testrun_compare ./dwarflint --check check_duplicate_DW_tag_variable crc7.ko.debug <<EOF
warning: .debug_line: offset 0x3c4: the include #6 \`XXXXXX' is not used.
warning: .debug_line: table 967: the include #6 \`XXXXXX' is not used.
-error: .debug_line: table 967: sequence of opcodes not terminated with DW_LNE_end_sequence.
error: .debug_info: DIE 0x3d21: Redeclaration of variable 'console_printk', originally seen at DIE 37f3.
error: .debug_info: DIE 0x3d2e: Redeclaration of variable 'hex_asc', originally seen at DIE 380b.
error: .debug_info: DIE 0x3d41: Redeclaration of variable '__per_cpu_offset', originally seen at DIE 382e.
error: .debug_abbrev: abbr. attribute 0x19: duplicate attribute byte_size (first was at 0x13).
error: .debug_abbrev: abbr. attribute 0x1b: duplicate attribute decl_file (first was at 0x15).
error: .debug_abbrev: abbr. attribute 0x1d: duplicate attribute decl_line (first was at 0x17).
-error: .debug_line: table 0: sequence of opcodes not terminated with DW_LNE_end_sequence.
EOF
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
testrun_compare ./dwarflint --check=@low libdl-2.12.so.debug <<EOF
-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.
+No errors
EOF