From 3c5d0c0fc4671e32c05d0050959251fc16958e21 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Tue, 17 Aug 2010 19:34:12 +0200 Subject: [PATCH] Move dwarflint to separate directory --- Makefile.am | 2 +- configure.ac | 2 +- dwarflint/Makefile.am | 104 ++++++++++++++++++ {src/dwarflint => dwarflint}/addr-record.cc | 0 {src/dwarflint => dwarflint}/addr-record.h | 0 {src/dwarflint => dwarflint}/all-dies-it.hh | 0 .../check_debug_abbrev.cc | 0 .../check_debug_abbrev.hh | 0 .../check_debug_abbrev.ii | 0 .../check_debug_aranges.cc | 0 .../check_debug_aranges.hh | 0 .../check_debug_info.cc | 2 +- .../check_debug_info.hh | 0 .../check_debug_info.ii | 0 .../check_debug_line.cc | 2 +- .../check_debug_loc_range.cc | 4 +- .../check_debug_loc_range.hh | 0 .../check_debug_pub.cc | 0 .../check_dups_abstract_origin.cc | 2 +- .../check_expected_trees.cc | 2 +- .../check_matching_ranges.cc | 0 .../check_range_out_of_scope.cc | 0 {src/dwarflint => dwarflint}/checks.hh | 0 {src/dwarflint => dwarflint}/coverage.cc | 0 {src/dwarflint => dwarflint}/coverage.h | 0 {src/dwarflint => dwarflint}/coverage.hh | 0 {src/dwarflint => dwarflint}/dwarflint.cc | 0 {src/dwarflint => dwarflint}/dwarflint.hh | 0 {src/dwarflint => dwarflint}/expected-at.cc | 0 {src/dwarflint => dwarflint}/expected.hh | 0 .../highlevel_check.cc | 0 .../highlevel_check.hh | 2 +- {src/dwarflint => dwarflint}/low.c | 4 +- {src/dwarflint => dwarflint}/low.h | 0 {src/dwarflint => dwarflint}/main.cc | 2 +- {src/dwarflint => dwarflint}/messages.cc | 0 {src/dwarflint => dwarflint}/messages.h | 0 {src/dwarflint => dwarflint}/misc.h | 0 .../config.cc => dwarflint/options.cc | 2 +- src/dwarflint/config.h => dwarflint/options.h | 0 dwarflint/pri.cc | 75 +++++++++++++ {src/dwarflint => dwarflint}/pri.hh | 0 {src/dwarflint => dwarflint}/readctx.c | 0 {src/dwarflint => dwarflint}/readctx.h | 0 {src/dwarflint => dwarflint}/reloc.cc | 0 {src/dwarflint => dwarflint}/reloc.h | 0 {src/dwarflint => dwarflint}/sections.cc | 2 +- {src/dwarflint => dwarflint}/sections.hh | 0 {src/dwarflint => dwarflint}/sections.ii | 0 {src/dwarflint => dwarflint}/tables.cc | 0 {src/dwarflint => dwarflint}/tables.h | 0 {src/dwarflint => dwarflint}/tables.hh | 0 {src/dwarflint => dwarflint}/where.c | 27 ++++- {src/dwarflint => dwarflint}/where.h | 0 src/Makefile.am | 32 +----- src/dwarflint/pri.cc | 50 --------- 56 files changed, 220 insertions(+), 96 deletions(-) create mode 100644 dwarflint/Makefile.am rename {src/dwarflint => dwarflint}/addr-record.cc (100%) rename {src/dwarflint => dwarflint}/addr-record.h (100%) rename {src/dwarflint => dwarflint}/all-dies-it.hh (100%) rename {src/dwarflint => dwarflint}/check_debug_abbrev.cc (100%) rename {src/dwarflint => dwarflint}/check_debug_abbrev.hh (100%) rename {src/dwarflint => dwarflint}/check_debug_abbrev.ii (100%) rename {src/dwarflint => dwarflint}/check_debug_aranges.cc (100%) rename {src/dwarflint => dwarflint}/check_debug_aranges.hh (100%) rename {src/dwarflint => dwarflint}/check_debug_info.cc (99%) rename {src/dwarflint => dwarflint}/check_debug_info.hh (100%) rename {src/dwarflint => dwarflint}/check_debug_info.ii (100%) rename {src/dwarflint => dwarflint}/check_debug_line.cc (99%) rename {src/dwarflint => dwarflint}/check_debug_loc_range.cc (99%) rename {src/dwarflint => dwarflint}/check_debug_loc_range.hh (100%) rename {src/dwarflint => dwarflint}/check_debug_pub.cc (100%) rename {src/dwarflint => dwarflint}/check_dups_abstract_origin.cc (99%) rename {src/dwarflint => dwarflint}/check_expected_trees.cc (99%) rename {src/dwarflint => dwarflint}/check_matching_ranges.cc (100%) rename {src/dwarflint => dwarflint}/check_range_out_of_scope.cc (100%) rename {src/dwarflint => dwarflint}/checks.hh (100%) rename {src/dwarflint => dwarflint}/coverage.cc (100%) rename {src/dwarflint => dwarflint}/coverage.h (100%) rename {src/dwarflint => dwarflint}/coverage.hh (100%) rename {src/dwarflint => dwarflint}/dwarflint.cc (100%) rename {src/dwarflint => dwarflint}/dwarflint.hh (100%) rename {src/dwarflint => dwarflint}/expected-at.cc (100%) rename {src/dwarflint => dwarflint}/expected.hh (100%) rename {src/dwarflint => dwarflint}/highlevel_check.cc (100%) rename {src/dwarflint => dwarflint}/highlevel_check.hh (99%) rename {src/dwarflint => dwarflint}/low.c (99%) rename {src/dwarflint => dwarflint}/low.h (100%) rename {src/dwarflint => dwarflint}/main.cc (99%) rename {src/dwarflint => dwarflint}/messages.cc (100%) rename {src/dwarflint => dwarflint}/messages.h (100%) rename {src/dwarflint => dwarflint}/misc.h (100%) rename src/dwarflint/config.cc => dwarflint/options.cc (98%) rename src/dwarflint/config.h => dwarflint/options.h (100%) create mode 100644 dwarflint/pri.cc rename {src/dwarflint => dwarflint}/pri.hh (100%) rename {src/dwarflint => dwarflint}/readctx.c (100%) rename {src/dwarflint => dwarflint}/readctx.h (100%) rename {src/dwarflint => dwarflint}/reloc.cc (100%) rename {src/dwarflint => dwarflint}/reloc.h (100%) rename {src/dwarflint => dwarflint}/sections.cc (99%) rename {src/dwarflint => dwarflint}/sections.hh (100%) rename {src/dwarflint => dwarflint}/sections.ii (100%) rename {src/dwarflint => dwarflint}/tables.cc (100%) rename {src/dwarflint => dwarflint}/tables.h (100%) rename {src/dwarflint => dwarflint}/tables.hh (100%) rename {src/dwarflint => dwarflint}/where.c (79%) rename {src/dwarflint => dwarflint}/where.h (100%) delete mode 100644 src/dwarflint/pri.cc diff --git a/Makefile.am b/Makefile.am index 4decc55f6..d5a94585a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,7 +31,7 @@ pkginclude_HEADERS = version.h # Add doc back when we have some real content. SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \ - src po tests + src po tests dwarflint EXTRA_DIST = elfutils.spec GPG-KEY NOTES EXCEPTION diff --git a/configure.ac b/configure.ac index 9de6f5ec4..631194bc1 100644 --- a/configure.ac +++ b/configure.ac @@ -232,7 +232,7 @@ dnl CPU-specific backend libraries. AC_CONFIG_FILES([backends/Makefile]) dnl Tools. -AC_CONFIG_FILES([src/Makefile po/Makefile.in]) +AC_CONFIG_FILES([src/Makefile po/Makefile.in dwarflint/Makefile]) dnl Test suite. AM_CONDITIONAL(STANDALONE, false)dnl Used in tests/Makefile.am, which see. diff --git a/dwarflint/Makefile.am b/dwarflint/Makefile.am new file mode 100644 index 000000000..cb0d2b8fd --- /dev/null +++ b/dwarflint/Makefile.am @@ -0,0 +1,104 @@ +## Process this file with automake to create Makefile.in +## +## Copyright (C) 1996-2010 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 +## . +## +include $(top_srcdir)/config/eu.am +DEFS += $(YYDEBUG) -DDEBUGPRED=@DEBUGPRED@ \ + -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\" +INCLUDES += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ + -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \ + -I$(srcdir)/../libasm + +AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw + +no_mudflap.os = -fmudflap + +bin_PROGRAMS = dwarflint + +dwarflint_SOURCES = main.cc \ + dwarflint.cc dwarflint.hh misc.h \ + low.c low.h \ + expected-at.cc expected.hh \ + coverage.cc coverage.h \ + readctx.c readctx.h \ + pri.cc pri.hh \ + messages.cc messages.h \ + where.c where.h \ + options.cc options.h \ + addr-record.cc addr-record.h \ + reloc.cc reloc.h \ + tables.cc tables.hh tables.h \ + all-dies-it.hh \ + checks.hh \ + sections.cc sections.hh sections.ii \ + highlevel_check.cc highlevel_check.hh \ + check_debug_abbrev.cc check_debug_abbrev.hh check_debug_abbrev.ii \ + check_debug_info.cc check_debug_info.hh check_debug_info.ii \ + check_debug_line.cc \ + check_debug_pub.cc \ + check_debug_loc_range.cc check_debug_loc_range.hh \ + check_debug_aranges.cc check_debug_aranges.hh \ + check_matching_ranges.cc \ + check_range_out_of_scope.cc \ + check_expected_trees.cc \ + check_dups_abstract_origin.cc \ + ../src/dwarfstrings.c + +if BUILD_STATIC +libasm = ../libasm/libasm.a +libdw = ../libdw/libdw.a $(zip_LIBS) $(libelf) $(libebl) -ldl +libelf = ../libelf/libelf.a +else +libasm = ../libasm/libasm.so +libdw = ../libdw/libdw.so +libelf = ../libelf/libelf.so +endif +libebl = ../libebl/libebl.a +libeu = ../lib/libeu.a + +# XXX later the C++ stuff will be in libdw.so directly +libdwpp = ../libdw/libdwpp.a $(libdw) + +dwarflint_LDADD = $(libebl) $(libelf) $(libdwpp) $(libeu) $(libmudflap) -ldl + +installcheck-binPROGRAMS: $(bin_PROGRAMS) + bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ + case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ + *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ + esac; \ + f=`echo "$$p" | \ + sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + for opt in --help --version; do \ + if LD_LIBRARY_PATH=$(DESTDIR)$(libdir) \ + $(DESTDIR)$(bindir)/$$f $$opt > c$${pid}_.out 2> c$${pid}_.err \ + && test -n "`cat c$${pid}_.out`" \ + && test -z "`cat c$${pid}_.err`"; then :; \ + else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \ + done; \ + done; rm -f c$${pid}_.???; exit $$bad + +CLEANFILES += *.gconv + +MAINTAINERCLEANFILES = diff --git a/src/dwarflint/addr-record.cc b/dwarflint/addr-record.cc similarity index 100% rename from src/dwarflint/addr-record.cc rename to dwarflint/addr-record.cc diff --git a/src/dwarflint/addr-record.h b/dwarflint/addr-record.h similarity index 100% rename from src/dwarflint/addr-record.h rename to dwarflint/addr-record.h diff --git a/src/dwarflint/all-dies-it.hh b/dwarflint/all-dies-it.hh similarity index 100% rename from src/dwarflint/all-dies-it.hh rename to dwarflint/all-dies-it.hh diff --git a/src/dwarflint/check_debug_abbrev.cc b/dwarflint/check_debug_abbrev.cc similarity index 100% rename from src/dwarflint/check_debug_abbrev.cc rename to dwarflint/check_debug_abbrev.cc diff --git a/src/dwarflint/check_debug_abbrev.hh b/dwarflint/check_debug_abbrev.hh similarity index 100% rename from src/dwarflint/check_debug_abbrev.hh rename to dwarflint/check_debug_abbrev.hh diff --git a/src/dwarflint/check_debug_abbrev.ii b/dwarflint/check_debug_abbrev.ii similarity index 100% rename from src/dwarflint/check_debug_abbrev.ii rename to dwarflint/check_debug_abbrev.ii diff --git a/src/dwarflint/check_debug_aranges.cc b/dwarflint/check_debug_aranges.cc similarity index 100% rename from src/dwarflint/check_debug_aranges.cc rename to dwarflint/check_debug_aranges.cc diff --git a/src/dwarflint/check_debug_aranges.hh b/dwarflint/check_debug_aranges.hh similarity index 100% rename from src/dwarflint/check_debug_aranges.hh rename to dwarflint/check_debug_aranges.hh diff --git a/src/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc similarity index 99% rename from src/dwarflint/check_debug_info.cc rename to dwarflint/check_debug_info.cc index 9ae820f1e..25f305aaf 100644 --- a/src/dwarflint/check_debug_info.cc +++ b/dwarflint/check_debug_info.cc @@ -34,7 +34,7 @@ #include "messages.h" #include "pri.hh" -#include "config.h" +#include "options.h" #include "sections.hh" #include "check_debug_loc_range.hh" #include "check_debug_abbrev.hh" diff --git a/src/dwarflint/check_debug_info.hh b/dwarflint/check_debug_info.hh similarity index 100% rename from src/dwarflint/check_debug_info.hh rename to dwarflint/check_debug_info.hh diff --git a/src/dwarflint/check_debug_info.ii b/dwarflint/check_debug_info.ii similarity index 100% rename from src/dwarflint/check_debug_info.ii rename to dwarflint/check_debug_info.ii diff --git a/src/dwarflint/check_debug_line.cc b/dwarflint/check_debug_line.cc similarity index 99% rename from src/dwarflint/check_debug_line.cc rename to dwarflint/check_debug_line.cc index a3947f20f..8a4deceaa 100644 --- a/src/dwarflint/check_debug_line.cc +++ b/dwarflint/check_debug_line.cc @@ -29,7 +29,7 @@ #include #include "../libdw/known-dwarf.h" -#include "dwarfstrings.h" +#include "../src/dwarfstrings.h" #include diff --git a/src/dwarflint/check_debug_loc_range.cc b/dwarflint/check_debug_loc_range.cc similarity index 99% rename from src/dwarflint/check_debug_loc_range.cc rename to dwarflint/check_debug_loc_range.cc index 26289ae7b..633e219a2 100644 --- a/src/dwarflint/check_debug_loc_range.cc +++ b/dwarflint/check_debug_loc_range.cc @@ -37,11 +37,11 @@ #include "../libdw/dwarf.h" #include "low.h" -#include "config.h" +#include "options.h" #include "check_debug_loc_range.hh" #include "check_debug_info.hh" #include "sections.hh" -#include "dwarf-opcodes.h" +#include "../src/dwarf-opcodes.h" #include "pri.hh" namespace diff --git a/src/dwarflint/check_debug_loc_range.hh b/dwarflint/check_debug_loc_range.hh similarity index 100% rename from src/dwarflint/check_debug_loc_range.hh rename to dwarflint/check_debug_loc_range.hh diff --git a/src/dwarflint/check_debug_pub.cc b/dwarflint/check_debug_pub.cc similarity index 100% rename from src/dwarflint/check_debug_pub.cc rename to dwarflint/check_debug_pub.cc diff --git a/src/dwarflint/check_dups_abstract_origin.cc b/dwarflint/check_dups_abstract_origin.cc similarity index 99% rename from src/dwarflint/check_dups_abstract_origin.cc rename to dwarflint/check_dups_abstract_origin.cc index a514d2682..f85f574ee 100644 --- a/src/dwarflint/check_dups_abstract_origin.cc +++ b/dwarflint/check_dups_abstract_origin.cc @@ -35,7 +35,7 @@ #endif #include "highlevel_check.hh" -#include "dwarfstrings.h" +#include "../src/dwarfstrings.h" #include "all-dies-it.hh" #include "pri.hh" #include "messages.h" diff --git a/src/dwarflint/check_expected_trees.cc b/dwarflint/check_expected_trees.cc similarity index 99% rename from src/dwarflint/check_expected_trees.cc rename to dwarflint/check_expected_trees.cc index 51e980b19..74b8903ec 100644 --- a/src/dwarflint/check_expected_trees.cc +++ b/dwarflint/check_expected_trees.cc @@ -5,7 +5,7 @@ #include "check_debug_info.hh" #include "highlevel_check.hh" #include "expected.hh" -#include "dwarfstrings.h" +#include "../src/dwarfstrings.h" #include "../libdw/c++/dwarf-knowledge.cc" #include "pri.hh" diff --git a/src/dwarflint/check_matching_ranges.cc b/dwarflint/check_matching_ranges.cc similarity index 100% rename from src/dwarflint/check_matching_ranges.cc rename to dwarflint/check_matching_ranges.cc diff --git a/src/dwarflint/check_range_out_of_scope.cc b/dwarflint/check_range_out_of_scope.cc similarity index 100% rename from src/dwarflint/check_range_out_of_scope.cc rename to dwarflint/check_range_out_of_scope.cc diff --git a/src/dwarflint/checks.hh b/dwarflint/checks.hh similarity index 100% rename from src/dwarflint/checks.hh rename to dwarflint/checks.hh diff --git a/src/dwarflint/coverage.cc b/dwarflint/coverage.cc similarity index 100% rename from src/dwarflint/coverage.cc rename to dwarflint/coverage.cc diff --git a/src/dwarflint/coverage.h b/dwarflint/coverage.h similarity index 100% rename from src/dwarflint/coverage.h rename to dwarflint/coverage.h diff --git a/src/dwarflint/coverage.hh b/dwarflint/coverage.hh similarity index 100% rename from src/dwarflint/coverage.hh rename to dwarflint/coverage.hh diff --git a/src/dwarflint/dwarflint.cc b/dwarflint/dwarflint.cc similarity index 100% rename from src/dwarflint/dwarflint.cc rename to dwarflint/dwarflint.cc diff --git a/src/dwarflint/dwarflint.hh b/dwarflint/dwarflint.hh similarity index 100% rename from src/dwarflint/dwarflint.hh rename to dwarflint/dwarflint.hh diff --git a/src/dwarflint/expected-at.cc b/dwarflint/expected-at.cc similarity index 100% rename from src/dwarflint/expected-at.cc rename to dwarflint/expected-at.cc diff --git a/src/dwarflint/expected.hh b/dwarflint/expected.hh similarity index 100% rename from src/dwarflint/expected.hh rename to dwarflint/expected.hh diff --git a/src/dwarflint/highlevel_check.cc b/dwarflint/highlevel_check.cc similarity index 100% rename from src/dwarflint/highlevel_check.cc rename to dwarflint/highlevel_check.cc diff --git a/src/dwarflint/highlevel_check.hh b/dwarflint/highlevel_check.hh similarity index 99% rename from src/dwarflint/highlevel_check.hh rename to dwarflint/highlevel_check.hh index dcc9e0b36..91ad2dd85 100644 --- a/src/dwarflint/highlevel_check.hh +++ b/dwarflint/highlevel_check.hh @@ -31,7 +31,7 @@ #endif #include "checks.hh" -#include "config.h" +#include "options.h" #include "c++/dwarf" #include "../libdwfl/libdwfl.h" diff --git a/src/dwarflint/low.c b/dwarflint/low.c similarity index 99% rename from src/dwarflint/low.c rename to dwarflint/low.c index 6766d4ded..e73fbe931 100644 --- a/src/dwarflint/low.c +++ b/dwarflint/low.c @@ -43,10 +43,10 @@ #include "../libdw/dwarf.h" #include "../libebl/libebl.h" -#include "dwarfstrings.h" +#include "../src/dwarfstrings.h" #include "low.h" #include "readctx.h" -#include "config.h" +#include "options.h" #include "tables.h" #define PRI_CU "CU 0x%" PRIx64 diff --git a/src/dwarflint/low.h b/dwarflint/low.h similarity index 100% rename from src/dwarflint/low.h rename to dwarflint/low.h diff --git a/src/dwarflint/main.cc b/dwarflint/main.cc similarity index 99% rename from src/dwarflint/main.cc rename to dwarflint/main.cc index c79a4e861..721116f99 100644 --- a/src/dwarflint/main.cc +++ b/dwarflint/main.cc @@ -34,7 +34,7 @@ #include #include "low.h" -#include "config.h" +#include "options.h" #include "dwarflint.hh" #include "readctx.h" #include "checks.hh" diff --git a/src/dwarflint/messages.cc b/dwarflint/messages.cc similarity index 100% rename from src/dwarflint/messages.cc rename to dwarflint/messages.cc diff --git a/src/dwarflint/messages.h b/dwarflint/messages.h similarity index 100% rename from src/dwarflint/messages.h rename to dwarflint/messages.h diff --git a/src/dwarflint/misc.h b/dwarflint/misc.h similarity index 100% rename from src/dwarflint/misc.h rename to dwarflint/misc.h diff --git a/src/dwarflint/config.cc b/dwarflint/options.cc similarity index 98% rename from src/dwarflint/config.cc rename to dwarflint/options.cc index ab878646b..ff3b5e2cd 100644 --- a/src/dwarflint/config.cc +++ b/dwarflint/options.cc @@ -23,7 +23,7 @@ Network licensing program, please visit www.openinventionnetwork.com . */ -#include "config.h" +#include "options.h" /* If true, we accept silently files without debuginfo. */ bool tolerate_nodebug = false; diff --git a/src/dwarflint/config.h b/dwarflint/options.h similarity index 100% rename from src/dwarflint/config.h rename to dwarflint/options.h diff --git a/dwarflint/pri.cc b/dwarflint/pri.cc new file mode 100644 index 000000000..fb9a9517b --- /dev/null +++ b/dwarflint/pri.cc @@ -0,0 +1,75 @@ +/* Pedantic checking of DWARF files + Copyright (C) 2008,2009,2010 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 + . */ + +#include "../src/dwarfstrings.h" +#include "pri.hh" +#include + +std::ostream & +pri::operator << (std::ostream &os, pri::pribase const &obj) +{ + return os << obj.m_s; +} + +pri::attr::attr (int attr_name) + : pribase (dwarf_attr_string (attr_name)) +{} + +pri::form::form (int attr_form) + : pribase (dwarf_form_string (attr_form)) +{} + +pri::tag::tag (int die_tag) + : pribase (dwarf_tag_string (die_tag)) +{} + +pri::locexpr_opcode::locexpr_opcode (int opcode) + : pribase (dwarf_locexpr_opcode_string (opcode)) +{} + +std::ostream & +pri::operator << (std::ostream &os, pri::ref const &obj) +{ + std::stringstream ss; + ss << std::hex << "DIE " << obj.off; + return os << ss.str (); +} + +std::ostream & +pri::operator << (std::ostream &os, pri::hex const &obj) +{ + std::stringstream ss; + if (obj.pre) + ss << obj.pre << " "; + ss << std::hex << "0x" << obj.value; + return os << ss.str (); +} + +std::ostream & +pri::operator << (std::ostream &os, pri::range const &obj) +{ + return os << "[" << pri::addr (obj.start) + << ", " << pri::addr (obj.end) << ")"; +} diff --git a/src/dwarflint/pri.hh b/dwarflint/pri.hh similarity index 100% rename from src/dwarflint/pri.hh rename to dwarflint/pri.hh diff --git a/src/dwarflint/readctx.c b/dwarflint/readctx.c similarity index 100% rename from src/dwarflint/readctx.c rename to dwarflint/readctx.c diff --git a/src/dwarflint/readctx.h b/dwarflint/readctx.h similarity index 100% rename from src/dwarflint/readctx.h rename to dwarflint/readctx.h diff --git a/src/dwarflint/reloc.cc b/dwarflint/reloc.cc similarity index 100% rename from src/dwarflint/reloc.cc rename to dwarflint/reloc.cc diff --git a/src/dwarflint/reloc.h b/dwarflint/reloc.h similarity index 100% rename from src/dwarflint/reloc.h rename to dwarflint/reloc.h diff --git a/src/dwarflint/sections.cc b/dwarflint/sections.cc similarity index 99% rename from src/dwarflint/sections.cc rename to dwarflint/sections.cc index 3a3ba2528..a4b51db71 100644 --- a/src/dwarflint/sections.cc +++ b/dwarflint/sections.cc @@ -35,7 +35,7 @@ #include "sections.hh" #include "messages.h" #include "pri.hh" -#include "config.h" +#include "options.h" namespace { diff --git a/src/dwarflint/sections.hh b/dwarflint/sections.hh similarity index 100% rename from src/dwarflint/sections.hh rename to dwarflint/sections.hh diff --git a/src/dwarflint/sections.ii b/dwarflint/sections.ii similarity index 100% rename from src/dwarflint/sections.ii rename to dwarflint/sections.ii diff --git a/src/dwarflint/tables.cc b/dwarflint/tables.cc similarity index 100% rename from src/dwarflint/tables.cc rename to dwarflint/tables.cc diff --git a/src/dwarflint/tables.h b/dwarflint/tables.h similarity index 100% rename from src/dwarflint/tables.h rename to dwarflint/tables.h diff --git a/src/dwarflint/tables.hh b/dwarflint/tables.hh similarity index 100% rename from src/dwarflint/tables.hh rename to dwarflint/tables.hh diff --git a/src/dwarflint/where.c b/dwarflint/where.c similarity index 79% rename from src/dwarflint/where.c rename to dwarflint/where.c index 3bfe0f606..3e2845656 100644 --- a/src/dwarflint/where.c +++ b/dwarflint/where.c @@ -1,5 +1,30 @@ +/* Pedantic checking of DWARF files + Copyright (C) 2008,2009,2010 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 + . */ + #include "where.h" -#include "config.h" +#include "options.h" #include #include diff --git a/src/dwarflint/where.h b/dwarflint/where.h similarity index 100% rename from src/dwarflint/where.h rename to dwarflint/where.h diff --git a/src/Makefile.am b/src/Makefile.am index 26486b02f..f2b22d8df 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,7 +46,7 @@ base_cpu = @base_cpu@ bin_PROGRAMS = readelf nm size strip ld elflint findtextrel addr2line \ elfcmp objdump ranlib strings ar unstrip \ - dwarflint dwarfcmp + dwarfcmp noinst_PROGRAMS = dwarfcmp-test @@ -78,35 +78,6 @@ dwarfcmp_test_CPPFLAGS = -DTEST dwarfcmp_test_SOURCES = $(dwarfcmp_SOURCES) dwarfcmp_test_LDADD = $(dwarfcmp_LDADD) -dwarflint_SOURCES = dwarfstrings.c \ - dwarflint/main.cc \ - dwarflint/dwarflint.cc dwarflint/dwarflint.hh dwarflint/misc.h \ - dwarflint/low.c dwarflint/low.h \ - dwarflint/expected-at.cc dwarflint/expected.hh \ - dwarflint/coverage.cc dwarflint/coverage.h \ - dwarflint/readctx.c dwarflint/readctx.h \ - dwarflint/pri.cc dwarflint/pri.hh \ - dwarflint/messages.cc dwarflint/messages.h \ - dwarflint/where.c dwarflint/where.h \ - dwarflint/config.cc dwarflint/config.h \ - 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 \ - dwarflint/check_dups_abstract_origin.cc - readelf_SOURCES = readelf.c dwarfstrings.c noinst_HEADERS = ld.h symbolhash.h sectionhash.h versionhash.h \ @@ -164,7 +135,6 @@ strings_LDADD = $(libelf) $(libeu) $(libmudflap) ar_LDADD = libar.a $(libelf) $(libeu) $(libmudflap) unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(libmudflap) -ldl dwarfcmp_LDADD = $(libdwpp) $(libmudflap) -ldl -dwarflint_LDADD = $(libebl) $(libelf) $(libdwpp) $(libeu) $(libmudflap) -ldl ldlex.o: ldscript.c ldlex_no_Werror = yes diff --git a/src/dwarflint/pri.cc b/src/dwarflint/pri.cc deleted file mode 100644 index 1beb799ab..000000000 --- a/src/dwarflint/pri.cc +++ /dev/null @@ -1,50 +0,0 @@ -#include "dwarfstrings.h" -#include "pri.hh" -#include - -std::ostream & -pri::operator << (std::ostream &os, pri::pribase const &obj) -{ - return os << obj.m_s; -} - -pri::attr::attr (int attr_name) - : pribase (dwarf_attr_string (attr_name)) -{} - -pri::form::form (int attr_form) - : pribase (dwarf_form_string (attr_form)) -{} - -pri::tag::tag (int die_tag) - : pribase (dwarf_tag_string (die_tag)) -{} - -pri::locexpr_opcode::locexpr_opcode (int opcode) - : pribase (dwarf_locexpr_opcode_string (opcode)) -{} - -std::ostream & -pri::operator << (std::ostream &os, pri::ref const &obj) -{ - std::stringstream ss; - ss << std::hex << "DIE " << obj.off; - return os << ss.str (); -} - -std::ostream & -pri::operator << (std::ostream &os, pri::hex const &obj) -{ - std::stringstream ss; - if (obj.pre) - ss << obj.pre << " "; - ss << std::hex << "0x" << obj.value; - return os << ss.str (); -} - -std::ostream & -pri::operator << (std::ostream &os, pri::range const &obj) -{ - return os << "[" << pri::addr (obj.start) - << ", " << pri::addr (obj.end) << ")"; -} -- 2.47.3