From: Petr Machata Date: Thu, 10 Mar 2011 13:54:09 +0000 (+0100) Subject: dwarflint: Fix last-die-has-sibling-attr message, don't let such to high-level X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fcacc3679244d2c046786539948d0c8db1b092f7;p=thirdparty%2Felfutils.git dwarflint: Fix last-die-has-sibling-attr message, don't let such to high-level --- diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc index f413ff856..4a1128cf2 100644 --- a/dwarflint/check_debug_info.cc +++ b/dwarflint/check_debug_info.cc @@ -583,9 +583,16 @@ namespace if (sibling_addr != 0) { if (abbr_code == 0) - wr_error (&where, - ": is the last sibling in chain, " - "but has a DW_AT_sibling attribute.\n"); + { + DEF_PREV_WHERE; + wr_error (&prev_where, + ": is the last sibling in chain, " + "but has a DW_AT_sibling attribute.\n"); + /* dwarf_siblingof uses DW_AT_sibling to look for + sibling DIEs. The value can't be right (there _is_ + no sibling), so don't let this up. */ + retval = -2; + } else if (sibling_addr != die_off) { DEF_PREV_WHERE; diff --git a/dwarflint/tests/garbage-9.bz2 b/dwarflint/tests/garbage-9.bz2 new file mode 100644 index 000000000..c2e7a8bf0 Binary files /dev/null and b/dwarflint/tests/garbage-9.bz2 differ diff --git a/dwarflint/tests/run-bad.sh b/dwarflint/tests/run-bad.sh index a59b74ad7..a956e2d30 100755 --- a/dwarflint/tests/run-bad.sh +++ b/dwarflint/tests/run-bad.sh @@ -29,7 +29,8 @@ srcdir=$srcdir/tests 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 + garbage-5 garbage-6 garbage-7 garbage-8 \ + garbage-9 testrun_compare ./dwarflint hello.bad-1 <