prev_die_off = die_off;
got_die = true;
- if (dump_die_offsets)
- std::cerr << "[" << level << "] "
- << where << ": abbrev " << abbr_code << std::endl;
/* Find the abbrev matching the code. */
abbrev = abbrevs->find_abbrev (abbr_code);
}
abbrev->used = true;
+ if (dump_die_offsets)
+ std::cerr << "[" << level << "] "
+ << where << ": abbrev " << abbr_code
+ << "; DIE tag 0x" << std::hex << abbrev->tag << std::endl;
+
// DWARF 4 Ch. 7.5: compilation unit header [is] followed by a
// single DW_TAG_compile_unit or DW_TAG_partial_unit.
bool is_cudie = level == 0
/*
- Copyright (C) 2009,2010 Red Hat, Inc.
+ Copyright (C) 2009,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
#include "where.h"
#include "dwarflint.hh"
#include "checkdescriptor.hh"
+#include "messages.hh"
#include <string>
#include <cassert>
= _m_checks.insert (std::make_pair (key, (T *)marker)).second;
assert (inserted || !"duplicate key");
+#define FAIL \
+ /* Put the anchor in the table. */ \
+ _m_checks[key] = NULL; \
+ report ("FAIL")
+
reporter report (stack, cd);
try
{
_m_checks.erase (key);
throw;
}
- catch (...)
+ catch (check_base::failed &e)
{
- // Nope, we failed. Put the anchor there.
- _m_checks[key] = NULL;
- report ("FAIL");
+ // We can assume that the check emitted error message.
+ FAIL;
throw;
}
+ catch (std::exception &e)
+ {
+ wr_error () << "A check failed: " << (cd.name () ?: "(nil)") << ": "
+ << e.what () << std::endl;
+ FAIL;
+ throw check_base::failed ();
+ }
+ catch (...)
+ {
+ wr_error () << "A check failed: " << (cd.name () ?: "(nil)") << "."
+ << std::endl;
+ FAIL;
+ throw check_base::failed ();
+ }
+
+#undef FAIL
report ("done");