From: Petr Machata Date: Tue, 8 Mar 2011 18:35:07 +0000 (+0100) Subject: dwarflint: Fix the check that DIE chains are terminated with null entry X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c92304c9dfac6419bb81326ab80d331f65c622c;p=thirdparty%2Felfutils.git dwarflint: Fix the check that DIE chains are terminated with null entry - and turn in to strict message - and update test cases --- diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc index 1ad33bcaf..ce245911d 100644 --- a/dwarflint/check_debug_info.cc +++ b/dwarflint/check_debug_info.cc @@ -589,13 +589,6 @@ namespace /* The section ended. */ if (abbr_code == 0) break; - if (read_ctx_eof (ctx)) - { - wr_error (where) - << "DIE chain not terminated with DIE with zero abbrev code." - << std::endl; - break; - } prev_die_off = die_off; got_die = true; @@ -928,6 +921,15 @@ namespace &where, ": abbrev has_children, but the chain was empty.\n"); } + + if (read_ctx_eof (ctx)) + { + // DWARF 4 Ch. 2.3: A chain of sibling entries is + // terminated by a null entry. + wr_message (where, cat (mc_impact_1, mc_info)) + << "DIE chain not terminated with null entry." << std::endl; + break; + } } if (sibling_addr != 0) diff --git a/dwarflint/tests/run-aranges_terminate_early.sh b/dwarflint/tests/run-aranges_terminate_early.sh index 7c5957091..36ed8a141 100755 --- a/dwarflint/tests/run-aranges_terminate_early.sh +++ b/dwarflint/tests/run-aranges_terminate_early.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2010 Red Hat, Inc. +# Copyright (C) 2010, 2011 Red Hat, Inc. # This file is part of Red Hat elfutils. # # Red Hat elfutils is free software; you can redistribute it and/or modify @@ -32,11 +32,13 @@ srcdir=$srcdir/tests testfiles aranges_terminate_early testrun_compare ./dwarflint --strict aranges_terminate_early <