From: Petr Machata Date: Thu, 10 Mar 2011 14:39:01 +0000 (+0100) Subject: dwarflint: Missing DW_LNE_end_sequence OK in empty line number program X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fef55ed3b49c1d1b632685e4079ca7caac759dc9;p=thirdparty%2Felfutils.git dwarflint: Missing DW_LNE_end_sequence OK in empty line number program - also the fact that the line number program is empty is not a problem in itself, only when combined with otherwise unused file table --- diff --git a/dwarflint/check_debug_line.cc b/dwarflint/check_debug_line.cc index 2f32e47ed..7fa097acf 100644 --- a/dwarflint/check_debug_line.cc +++ b/dwarflint/check_debug_line.cc @@ -596,22 +596,29 @@ check_debug_line::check_debug_line (checkstack &stack, dwarflint &lint) << " `" << 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; diff --git a/dwarflint/tests/run-bad.sh b/dwarflint/tests/run-bad.sh index a956e2d30..3803336a7 100755 --- a/dwarflint/tests/run-bad.sh +++ b/dwarflint/tests/run-bad.sh @@ -46,7 +46,6 @@ EOF testrun_compare ./dwarflint empty-1 <