]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Get rid of low.h/low.c
authorPetr Machata <pmachata@redhat.com>
Wed, 22 Sep 2010 14:48:50 +0000 (16:48 +0200)
committerPetr Machata <pmachata@redhat.com>
Wed, 22 Sep 2010 14:48:50 +0000 (16:48 +0200)
- and rename misc.h to misc.hh

24 files changed:
dwarflint/Makefile.am
dwarflint/addr-record.cc
dwarflint/check_debug_abbrev.cc
dwarflint/check_debug_aranges.cc
dwarflint/check_debug_aranges.hh
dwarflint/check_debug_info.cc
dwarflint/check_debug_line.cc
dwarflint/check_debug_line.hh
dwarflint/check_debug_loc_range.cc
dwarflint/check_debug_pub.cc
dwarflint/check_debug_pub.hh
dwarflint/check_range_out_of_scope.cc
dwarflint/coverage.cc
dwarflint/elf_file.hh [moved from dwarflint/low.h with 55% similarity]
dwarflint/main.cc
dwarflint/messages.cc
dwarflint/misc.cc [moved from dwarflint/low.cc with 99% similarity]
dwarflint/misc.hh [moved from dwarflint/misc.h with 83% similarity]
dwarflint/pri.hh
dwarflint/readctx.c
dwarflint/reloc.cc
dwarflint/reloc.hh
dwarflint/sections.cc
dwarflint/sections.hh

index f83cef4c6b7b485075d559cbac50e2011b0d05dc..70cae267990b0be413c45ad057d29799e57a14c0 100644 (file)
@@ -38,28 +38,29 @@ no_mudflap.os = -fmudflap
 bin_PROGRAMS = dwarflint
 
 dwarflint_SOURCES = \
-       main.cc \
+       addr-record.cc addr-record.hh \
+       all-dies-it.hh \
        checkdescriptor.cc checkdescriptor.hh checkdescriptor.ii \
+       checked_read.cc checked_read.hh \
        checkrule.cc checkrule.hh \
-       dwarflint.cc dwarflint.hh dwarflint.ii misc.h \
-       low.cc low.h elf_file.ii \
-       expected-at.cc expected.hh \
+       checks.cc checks.hh checks.ii \
        coverage.cc coverage.hh \
-       readctx.c readctx.h \
-       checked_read.cc checked_read.hh \
-       pri.cc pri.hh \
+       cu_coverage.cc cu_coverage.hh cu_coverage.ii \
+       dwarflint.cc dwarflint.hh dwarflint.ii \
+       elf_file.hh elf_file.ii \
+       expected-at.cc expected.hh \
+       highlevel_check.cc highlevel_check.hh \
+       main.cc \
        messages.cc messages.hh \
-       section_id.cc section_id.hh \
-       where.c where.h \
+       misc.cc misc.hh \
        option.cc option.hh \
-       addr-record.cc addr-record.hh \
+       pri.cc pri.hh \
+       readctx.c readctx.h \
        reloc.cc reloc.hh \
-       tables.cc tables.hh \
-       all-dies-it.hh \
-       checks.cc checks.hh checks.ii \
+       section_id.cc section_id.hh \
        sections.cc sections.hh sections.ii \
-       highlevel_check.cc highlevel_check.hh \
-       cu_coverage.cc cu_coverage.hh cu_coverage.ii \
+       tables.cc tables.hh \
+       where.c where.h \
        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_line.hh check_debug_line.ii \
index 5c4234a7c87b1a8abdb7a58c4493b0c5449725d7..ec31eba2e1969ba000ef75386f87aba30b2f6837 100644 (file)
@@ -24,7 +24,7 @@
    <http://www.openinventionnetwork.com>.  */
 
 #include "addr-record.hh"
-#include "misc.h"
+#include "misc.hh"
 
 size_t
 addr_record_find_addr (struct addr_record *ar, uint64_t addr)
index a46f0e8ea9fcdadd197f34e44d1632a74df5db57..ed19b134f11e59ba21c0fa66e5d590b8b9c9f8fb 100644 (file)
@@ -34,7 +34,7 @@
 #include "sections.hh"
 #include "checked_read.hh"
 #include "messages.hh"
-#include "misc.h"
+#include "misc.hh"
 
 #include <dwarf.h>
 #include <sstream>
index 88bc7c91fea65d2739bc4dfa0388c4791f81a555..c817fd9d0e7606b27f9e076eb80fb088fb2478a6 100644 (file)
 
 #include <inttypes.h>
 
-#include "low.h"
+#include "elf_file.hh"
 #include "sections.hh"
 #include "check_debug_aranges.hh"
 #include "check_debug_info.hh"
 #include "check_debug_loc_range.hh"
 #include "cu_coverage.hh"
 #include "checked_read.hh"
+#include "misc.hh"
+#include "pri.hh"
 
 checkdescriptor const *
 check_debug_aranges::descriptor ()
index dbd0726eb24009795f65cde21dc0f9e134a31fd1..47aa145fefce63898dfb8652fec82e411c67e635 100644 (file)
@@ -1,5 +1,5 @@
 /* Low-level checking of .debug_aranges.
-   Copyright (C) 2009 Red Hat, Inc.
+   Copyright (C) 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
@@ -26,7 +26,6 @@
 #ifndef DWARFLINT_CHECK_DEBUG_ARANGES_HH
 #define DWARFLINT_CHECK_DEBUG_ARANGES_HH
 
-#include "low.h"
 #include "checks.hh"
 #include "sections.ii"
 #include "check_debug_info.ii"
index c9bced674c4caa6421e13632dfca95a174b21ef4..a69a9076570999893286da294c920c8b4ad7a8a9 100644 (file)
@@ -42,7 +42,7 @@
 #include "check_debug_abbrev.hh"
 #include "check_debug_info.hh"
 #include "check_debug_line.hh"
-#include "misc.h"
+#include "misc.hh"
 
 checkdescriptor const *
 read_cu_headers::descriptor ()
index 64c1a09a7d13a027694e79f455bcde245275fbe9..fe44618a4f7277d5502e68b0611ea446d7fc6170 100644 (file)
@@ -29,6 +29,7 @@
 #include "pri.hh"
 #include "checked_read.hh"
 #include "messages.hh"
+#include "misc.hh"
 
 #include <dwarf.h>
 #include "../libdw/known-dwarf.h"
index a70982d170d380ce8dd8681919cf42477cd142fe..a38f7ef70f49bdc4da7c8e26c4883681ea983965 100644 (file)
@@ -29,8 +29,9 @@
 #include "check_debug_info.ii"
 #include "sections.ii"
 #include "checks.hh"
+
+#include "../libdw/libdw.h"
 #include <set>
-#include "low.h"
 
 class check_debug_line
   : public check<check_debug_line>
index 6f5251ad77d185cefc7b6957d0a77d866a4d14cf..b8456b91920a9f3b4bf1cb486804347a92bc2ebe 100644 (file)
 #include <algorithm>
 #include "../libdw/dwarf.h"
 
-#include "low.h"
+#include "elf_file.hh"
 #include "check_debug_loc_range.hh"
 #include "check_debug_info.hh"
 #include "sections.hh"
 #include "checked_read.hh"
 #include "../src/dwarf-opcodes.h"
 #include "pri.hh"
-#include "misc.h"
+#include "misc.hh"
 
 bool do_range_coverage = false; // currently no option
 
index 354a631674ef878c29aca3a92ed9b00e16758eb6..008355863fb02c4d1949803e4f812c929183d02f 100644 (file)
@@ -29,6 +29,7 @@
 #include "pri.hh"
 #include "checked_read.hh"
 #include "messages.hh"
+#include "misc.hh"
 
 template<section_id sec_id>
 check_debug_pub<sec_id>::check_debug_pub (checkstack &stack, dwarflint &lint)
index 97415f8c81574de6df7047e0f9a52f4ee7f5f9cd..663c400dc2ff28e2584017daa427e5f548c98a01 100644 (file)
@@ -29,7 +29,7 @@
 #include "sections.ii"
 #include "check_debug_info.ii"
 #include "checks.hh"
-#include "low.h"
+#include "elf_file.ii"
 
 template<section_id sec_id>
 class check_debug_pub
index df6cda798c42c536cb86ce9912b658d2da239680..db774998ba158f000343be7d61042c43e457a5fe 100644 (file)
@@ -31,7 +31,7 @@
 #include "coverage.hh"
 #include "pri.hh"
 #include "check_debug_loc_range.hh"
-#include "misc.h"
+#include "misc.hh"
 
 using elfutils::dwarf;
 
index 80e3be5873f01b611742c2f56f540accd181adde..fde4351bfbcc66bd354da1896b73e353658be4c5 100644 (file)
@@ -29,8 +29,8 @@
 #endif
 
 #include "coverage.hh"
+#include "misc.hh"
 #include "pri.hh"
-#include "misc.h"
 
 #include <stdbool.h>
 #include <assert.h>
similarity index 55%
rename from dwarflint/low.h
rename to dwarflint/elf_file.hh
index 8f4d4424c75d29b31e960ea320c34e83c649fcd5..d283e7877b764426edf7f3d8e72afa0581eb4593 100644 (file)
    Network licensing program, please visit www.openinventionnetwork.com
    <http://www.openinventionnetwork.com>.  */
 
-#ifndef DWARFLINT_LOW_H
-#define DWARFLINT_LOW_H
+#ifndef DWARFLINT_ELF_FILE_HH
+#define DWARFLINT_ELF_FILE_HH
 
 #include "../libdw/libdw.h"
 #include "../libebl/libebl.h"
 #include "reloc.hh"
 
-#ifdef __cplusplus
-extern "C"
+struct sec
 {
-#else
-# include <stdbool.h>
-#endif
+  GElf_Shdr shdr;
+  struct relocation_data rel;
+  Elf_Scn *scn;
+  const char *name;
 
-  struct sec
-  {
-    GElf_Shdr shdr;
-    struct relocation_data rel;
-    Elf_Scn *scn;
-    const char *name;
-
-    Elf_Data *data;    /* May be NULL if data in this section are
+  Elf_Data *data;      /* May be NULL if data in this section are
                           missing or not substantial.  */
-    enum section_id id;
-  };
-
-  struct elf_file
-  {
-    GElf_Ehdr ehdr;    /* Header of underlying Elf.  */
-    Elf *elf;
-    Ebl *ebl;
+  enum section_id id;
+};
 
-    struct sec *sec;   /* Array of sections.  */
-    size_t size;
-    size_t alloc;
-
-    /* Pointers into SEC above.  Maps section_id to section.  */
-    struct sec *debugsec[count_debuginfo_sections];
+struct elf_file
+{
+  GElf_Ehdr ehdr;      /* Header of underlying Elf.  */
+  Elf *elf;
+  Ebl *ebl;
 
-    bool addr_64;      /* True if it's 64-bit Elf.  */
-    bool other_byte_order; /* True if the file has a byte order
-                             different from the host.  */
-  };
+  struct sec *sec;     /* Array of sections.  */
+  size_t size;
+  size_t alloc;
 
-  extern bool address_aligned (uint64_t addr, uint64_t align);
-  extern bool necessary_alignment (uint64_t start, uint64_t length,
-                                  uint64_t align);
-#define PRI_NOT_ENOUGH ": not enough data for %s.\n"
-  extern bool supported_version (unsigned version,
-                                size_t num_supported, struct where *where, ...);
+  /* Pointers into SEC above.  Maps section_id to section.  */
+  struct sec *debugsec[count_debuginfo_sections];
 
-#ifdef __cplusplus
-}
-#endif
+  bool addr_64;        /* True if it's 64-bit Elf.  */
+  bool other_byte_order; /* True if the file has a byte order
+                           different from the host.  */
+};
 
-#endif/*DWARFLINT_LOW_H*/
+#endif/*DWARFLINT_ELF_FILE_HH*/
index 16850628b75e441cf07db5f65321912388089807..c2670c5332fe5751d2a2450ce2ceb58beb46495d 100644 (file)
@@ -33,7 +33,6 @@
 #include <iostream>
 #include <sstream>
 
-#include "low.h"
 #include "dwarflint.hh"
 #include "readctx.h"
 #include "checks.hh"
index 784dffb7bfedbc6e27a4e8386b16d9c9412fc372..1c2f974bc6d9c985b55bfce11a6e035cbcd3dd7c 100644 (file)
@@ -24,7 +24,7 @@
    <http://www.openinventionnetwork.com>.  */
 
 #include "messages.hh"
-#include "misc.h"
+#include "misc.hh"
 #include "coverage.hh"
 
 #include <vector>
similarity index 99%
rename from dwarflint/low.cc
rename to dwarflint/misc.cc
index 30c2f2b31963017de4f638da83a717e8ff834ec8..497ee114ef90f3d566b94aa1c46a14939aae7af4 100644 (file)
@@ -27,7 +27,7 @@
 # include <config.h>
 #endif
 
-#include "low.h"
+#include "misc.hh"
 #include "messages.hh"
 #include <stdarg.h>
 
similarity index 83%
rename from dwarflint/misc.h
rename to dwarflint/misc.hh
index c23371436278d33408cf2cbbc4080dc6a84cd4b5..79b6014725a99bbed235e5d5edf5e1082c6a0aa6 100644 (file)
    Network licensing program, please visit www.openinventionnetwork.com
    <http://www.openinventionnetwork.com>.  */
 
-#ifndef DWARFLINT_MISC_H
-#define DWARFLINT_MISC_H
+#ifndef DWARFLINT_MISC_HH
+#define DWARFLINT_MISC_HH
 
-#include <string.h>
+#include <cstring>
+#include "where.h"
+
+extern "C"
+{
+#include "../lib/system.h"
+}
 
 #define REALLOC(A, BUF)                                                \
   do {                                                         \
 
 #define WIPE(OBJ) memset (&OBJ, 0, sizeof (OBJ))
 
-#ifdef __cplusplus
-# define IF_CPLUSPLUS(X) X
-#else
-# define IF_CPLUSPLUS(X) /*X*/
-#endif
+bool address_aligned (uint64_t addr, uint64_t align);
+bool necessary_alignment (uint64_t start, uint64_t length,
+                         uint64_t align);
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
+bool supported_version (unsigned version,
+                       size_t num_supported, struct where *where, ...);
 
-#include "../lib/system.h"
-
-#ifdef __cplusplus
-}
-#endif
 
-#endif//DWARFLINT_MISC_H
+#endif//DWARFLINT_MISC_HH
index 33a3a2e697e65cb9f74735162d512dfc1788ca2f..1f4ad6ae2f6f1d333a9780a59cb5f400cbb4ae63 100644 (file)
@@ -29,6 +29,8 @@
 #include <libdw.h>
 #include <string>
 
+#define PRI_NOT_ENOUGH ": not enough data for %s.\n"
+
 namespace pri
 {
   class pribase
index afd041dc90bd6e0aa93a65a1fd7d2dcb14dfdd98..8807215f6d0b9ed664b5af5dd360f6036271c1cb 100644 (file)
@@ -25,7 +25,6 @@
    <http://www.openinventionnetwork.com>.  */
 
 #include "readctx.h"
-#include "low.h"
 #include "../libdw/dwarf.h"
 
 #include <stdlib.h>
index 94730466ba9ba148796660d34b21dc27a84f98ef..eaaf5341af30b33f31d9d987f0d225bbb717848a 100644 (file)
 // xxx drop as soon as not necessary
 #define __STDC_FORMAT_MACROS
 
-#include "low.h"
 #include "reloc.hh"
+#include "elf_file.hh"
 #include "messages.hh"
-#include "misc.h"
+#include "misc.hh"
 #include "readctx.h"
 
 #include <sstream>
index e5d292bace1c298784d69c4bc1802c96c3819b69..74a444b4aee9c5e973d1db02bbe4688a5379d6b3 100644 (file)
@@ -66,10 +66,10 @@ enum skip_type
 bool read_rel (struct elf_file *file, struct sec *sec,
               Elf_Data *reldata, bool elf_64);
 
-struct relocation *relocation_next (struct relocation_data *reloc,
-                                   uint64_t offset,
-                                   struct where const *where,
-                                   enum skip_type st);
+relocation *relocation_next (struct relocation_data *reloc,
+                            uint64_t offset,
+                            struct where const *where,
+                            enum skip_type st);
 
 void relocation_reset (struct relocation_data *reloc);
 
index a81d7dc62975cdd0b1fe7a1f5a20e5a6335c7f14..b1fb2a6723921bbfb746b69f27be89bfc8538db0 100644 (file)
@@ -34,7 +34,7 @@
 #include "sections.hh"
 #include "messages.hh"
 #include "pri.hh"
-#include "misc.h"
+#include "misc.hh"
 
 checkdescriptor const *
 load_sections::descriptor ()
index d216b004905d3b83846a1c48c128c7abfc1f0553..1d488fbc6100e3907879a2f999955c83d710dc7a 100644 (file)
@@ -1,5 +1,5 @@
 /* Low-level section handling.
-   Copyright (C) 2009 Red Hat, Inc.
+   Copyright (C) 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
@@ -27,7 +27,7 @@
 #define DWARFLINT_SECTIONS_HH
 
 #include "checks.hh"
-#include "low.h"
+#include "elf_file.hh"
 
 class load_sections
   : public check<load_sections>