dwarflint/messages.cc dwarflint/messages.h \
dwarflint/where.c dwarflint/where.h \
dwarflint/config.cc dwarflint/config.h \
- dwarflint/checks.hh \
- dwarflint/checks-low.cc dwarflint/checks-low.hh \
dwarflint/addr-record.cc dwarflint/addr-record.h \
dwarflint/reloc.cc dwarflint/reloc.h \
dwarflint/tables.cc dwarflint/tables.hh dwarflint/tables.h \
dwarflint/all-dies-it.hh \
+ dwarflint/checks.hh \
+ dwarflint/sections.cc dwarflint/sections.hh dwarflint/sections.ii \
dwarflint/highlevel_check.cc dwarflint/highlevel_check.hh \
dwarflint/check_debug_abbrev.cc dwarflint/check_debug_abbrev.hh dwarflint/check_debug_abbrev.ii \
dwarflint/check_debug_info.cc dwarflint/check_debug_info.hh dwarflint/check_debug_info.ii \
dwarflint/check_debug_line.cc \
dwarflint/check_debug_pub.cc \
dwarflint/check_debug_loc_range.cc dwarflint/check_debug_loc_range.hh \
+ dwarflint/check_debug_aranges.cc dwarflint/check_debug_aranges.hh \
dwarflint/check_matching_ranges.cc \
dwarflint/check_range_out_of_scope.cc \
dwarflint/check_expected_trees.cc \
# include <config.h>
#endif
-#include "checks-low.hh"
-#include "pri.hh"
-#include "tables.hh"
#include "check_debug_info.hh"
#include "check_debug_abbrev.hh"
+#include "pri.hh"
+#include "tables.hh"
+#include "sections.hh"
#include <dwarf.h>
#include <sstream>
#ifndef DWARFLINT_CHECK_DEBUG_ABBREV_HH
#define DWARFLINT_CHECK_DEBUG_ABBREV_HH
-#include "checks-low.hh"
-
class check_debug_abbrev
: public check<check_debug_abbrev>
{
--- /dev/null
+/* Low-level checking of .debug_aranges.
+ Copyright (C) 2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "low.h"
+#include "sections.hh"
+#include "check_debug_aranges.hh"
+#include "check_debug_info.hh"
+#include "check_debug_loc_range.hh"
+
+check_debug_aranges::check_debug_aranges (dwarflint &lint)
+ : _m_sec_aranges (lint.check (_m_sec_aranges))
+{
+ check_debug_info *info = lint.toplev_check<check_debug_info> ();
+ coverage *cov = NULL;
+ if (info != NULL)
+ {
+ // xxx If need_ranges is true, we have to load ranges first.
+ // That's a flaw in design of checks, that data should have been
+ // stored in check_ranges, and that should have been requested
+ // explicitly. But for the time being...
+ if (info->cu_cov.need_ranges)
+ lint.toplev_check<check_debug_ranges> ();
+ if (!info->cu_cov.need_ranges)
+ cov = &info->cu_cov.cov;
+ }
+
+ if (!check_aranges_structural (&_m_sec_aranges->file,
+ &_m_sec_aranges->sect,
+ info != NULL ? &info->cus.front () : NULL,
+ cov))
+ throw check_base::failed ();
+}
--- /dev/null
+/* Low-level checking of .debug_aranges.
+ Copyright (C) 2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifndef DWARFLINT_CHECKS_LOW_HH
+#define DWARFLINT_CHECKS_LOW_HH
+
+#include "low.h"
+#include "checks.hh"
+#include "sections.ii"
+
+class check_debug_aranges
+ : public check<check_debug_aranges>
+{
+ section<sec_aranges> *_m_sec_aranges;
+
+public:
+ explicit check_debug_aranges (dwarflint &lint);
+};
+static reg<check_debug_aranges> reg_debug_aranges;
+
+#endif//DWARFLINT_CHECKS_LOW_HH
#include "messages.h"
#include "pri.hh"
#include "config.h"
+#include "sections.hh"
#include "check_debug_loc_range.hh"
#include "check_debug_abbrev.hh"
#include "check_debug_info.hh"
#ifndef DWARFLINT_CHECK_DEBUG_INFO_HH
#define DWARFLINT_CHECK_DEBUG_INFO_HH
-#include "checks-low.hh"
#include "check_debug_abbrev.ii"
+#include "sections.ii"
+#include "checks.hh"
+#include "low.h"
/** The pass for reading basic .debug_info data -- the layout of
sections and their headers. */
-#include "checks-low.hh"
+/* Low-level checking of .debug_line.
+ Copyright (C) 2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
#include "check_debug_info.hh"
+#include "sections.hh"
#include "pri.hh"
#include <dwarf.h>
#include "config.h"
#include "check_debug_loc_range.hh"
#include "check_debug_info.hh"
+#include "sections.hh"
#include "dwarf-opcodes.h"
#include "pri.hh"
-/* Routines related to .debug_loc and .debug_range.
-
+/* Low-level checking of .debug_loc and .debug_range.
Copyright (C) 2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Network licensing program, please visit www.openinventionnetwork.com
<http://www.openinventionnetwork.com>. */
-#include "checks-low.hh"
+#include "sections.ii"
#include "check_debug_info.ii"
+#include "checks.hh"
+#include "messages.h"
+#include "low.h"
class check_debug_ranges
: public check<check_debug_ranges>
-#include "checks-low.hh"
+/* Low-level checking of .debug_pub*.
+ Copyright (C) 2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
#include "check_debug_info.hh"
+#include "sections.hh"
#include "pri.hh"
namespace
#include "dwarfstrings.h"
#include "all-dies-it.hh"
#include "pri.hh"
+#include "messages.h"
#include <map>
using elfutils::dwarf;
#include "highlevel_check.hh"
#include "check_debug_loc_range.hh"
+#include "check_debug_aranges.hh"
using elfutils::dwarf;
<http://www.openinventionnetwork.com>. */
#include "highlevel_check.hh"
+#include "messages.h"
namespace
{
# include <config.h>
#endif
-#include "checks-low.hh"
+#include "checks.hh"
#include "config.h"
#include "c++/dwarf"
#include "../libdwfl/libdwfl.h"
#include "dwarflint.hh"
#include "readctx.h"
#include "checks.hh"
-#include "checks-low.hh" // xxx
/* Bug report address. */
const char *argp_program_bug_address = PACKAGE_BUGREPORT;
-/* Pedantic checking of DWARF files
+/* Low-level section handling.
Copyright (C) 2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
# include <config.h>
#endif
-#include "low.h"
-#include "config.h"
-#include "pri.hh"
-#include "check_debug_loc_range.hh"
-#include "check_debug_info.hh"
-#include <map>
-#include <sstream>
+#include <cstdlib>
#include <cstring>
-#include <cassert>
+#include <sstream>
+#include "../libelf/gelf.h"
+#include "sections.hh"
+
+#include "messages.h"
+#include "pri.hh"
+#include "config.h"
namespace
{
, file (sections->file)
{
}
-
-check_debug_aranges::check_debug_aranges (dwarflint &lint)
- : _m_sec_aranges (lint.check (_m_sec_aranges))
-{
- check_debug_info *info = lint.toplev_check<check_debug_info> ();
- coverage *cov = NULL;
- if (info != NULL)
- {
- // xxx If need_ranges is true, we have to load ranges first.
- // That's a flaw in design of checks, that data should have been
- // stored in check_ranges, and that should have been requested
- // explicitly. But for the time being...
- if (info->cu_cov.need_ranges)
- lint.toplev_check<check_debug_ranges> ();
- if (!info->cu_cov.need_ranges)
- cov = &info->cu_cov.cov;
- }
-
- if (!check_aranges_structural (&_m_sec_aranges->file,
- &_m_sec_aranges->sect,
- info != NULL ? &info->cus.front () : NULL,
- cov))
- throw check_base::failed ();
-}
-/*
+/* Low-level section handling.
Copyright (C) 2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Network licensing program, please visit www.openinventionnetwork.com
<http://www.openinventionnetwork.com>. */
-#ifndef DWARFLINT_CHECKS_LOW_HH
-#define DWARFLINT_CHECKS_LOW_HH
+#ifndef DWARFLINT_SECTIONS_HH
+#define DWARFLINT_SECTIONS_HH
-#include "low.h"
#include "checks.hh"
+#include "low.h"
class load_sections
: public check<load_sections>
}
};
-template<section_id sec_id>
+template<unsigned sec_id>
class section
: public section_base
, public check<section<sec_id> >
{
public:
explicit section (dwarflint &lint)
- : section_base (lint, sec_id)
+ : section_base (lint, static_cast <enum section_id> (sec_id))
{}
};
-class check_debug_aranges
- : public check<check_debug_aranges>
-{
- section<sec_aranges> *_m_sec_aranges;
-
-public:
- explicit check_debug_aranges (dwarflint &lint);
-};
-static reg<check_debug_aranges> reg_debug_aranges;
-
-#endif//DWARFLINT_CHECKS_LOW_HH
+#endif//DWARFLINT_SECTIONS_HH
--- /dev/null
+template<unsigned> class section;