From 50a611a24f8e2b48ebefc79aacfb8b6b1d472d79 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Wed, 18 Aug 2010 19:16:13 +0200 Subject: [PATCH] dwarflint: Check all the abbreviation instead of bailing out on first error --- dwarflint/check_debug_abbrev.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dwarflint/check_debug_abbrev.cc b/dwarflint/check_debug_abbrev.cc index 0c0b3558d..49a6d1c0c 100644 --- a/dwarflint/check_debug_abbrev.cc +++ b/dwarflint/check_debug_abbrev.cc @@ -298,7 +298,9 @@ namespace bool low_pc = false; bool high_pc = false; bool ranges = false; + bool failed = false; std::map seen; + do { uint64_t attr_off = read_ctx_get_offset (&ctx); @@ -330,7 +332,8 @@ namespace wr_error (where) << "invalid name " << pri::hex (attrib_name) << '.' << std::endl; - throw check_base::failed (); + failed = true; + continue; } if (!ver->form_allowed (attrib_form)) @@ -338,7 +341,10 @@ namespace wr_error (where) << "invalid form " << pri::hex (attrib_form) << '.' << std::endl; - throw check_base::failed (); + failed = true; + continue; + } + std::pair::iterator, bool> inserted = seen.insert (std::make_pair (attrib_name, attr_off)); if (!inserted.second) @@ -438,6 +444,9 @@ namespace wr_error (where) << "the abbrev has DW_AT_high_pc & DW_AT_low_pc, " << "but also has DW_AT_ranges." << std::endl; + + if (failed) + throw check_base::failed (); } abbrev_table *last = NULL; -- 2.47.3