]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Move much of the rest of low.h to where it belongs
authorPetr Machata <pmachata@redhat.com>
Tue, 21 Sep 2010 21:32:43 +0000 (23:32 +0200)
committerPetr Machata <pmachata@redhat.com>
Tue, 21 Sep 2010 21:32:43 +0000 (23:32 +0200)
dwarflint/Makefile.am
dwarflint/check_debug_info.hh
dwarflint/check_debug_loc_range.hh
dwarflint/low.cc [moved from dwarflint/low.c with 97% similarity]
dwarflint/low.h
dwarflint/reloc.cc
dwarflint/sections.cc

index 673d94f926cd187b6f4fdf1b56146243a368095a..92c5b8a0b4cb1362ae313fe4cb55b1a7a6a3baef 100644 (file)
@@ -42,7 +42,7 @@ dwarflint_SOURCES = \
        checkdescriptor.cc checkdescriptor.hh checkdescriptor.ii \
        checkrule.cc checkrule.hh \
        dwarflint.cc dwarflint.hh dwarflint.ii misc.h \
-       low.c low.h elf_file.ii \
+       low.cc low.h elf_file.ii \
        expected-at.cc expected.hh \
        coverage.cc coverage.h \
        readctx.c readctx.h \
index df80baa0c0a73ab1810d0cbfe362e9b163daaa1c..d5aa1a3043f345bb0a3904ff5fa0182f34f85916 100644 (file)
@@ -1,5 +1,5 @@
 /* Low-level checking of .debug_info.
-   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
 #ifndef DWARFLINT_CHECK_DEBUG_INFO_HH
 #define DWARFLINT_CHECK_DEBUG_INFO_HH
 
-#include "low.h"
+#include <libdw.h>
+#include "addr-record.h"
+#include "elf_file.ii"
+#include "coverage.hh"
 #include "checks.hh"
 #include "check_debug_abbrev.ii"
 #include "check_debug_line.ii"
 #include "sections.ii"
 
+struct cu_head
+{
+  uint64_t offset;
+  Dwarf_Off size;               // Size of this CU.
+  Dwarf_Off head_size;          // Size from begin to 1st byte of CU.
+  Dwarf_Off total_size;         // size + head_size
+
+  int offset_size;               // Offset size in this CU.
+  struct where where;           // Where was this section defined.
+  Dwarf_Off abbrev_offset;      // Abbreviation section that this CU uses.
+  int version;                  // CU version
+  int address_size;             // Address size in bytes on the target machine.
+};
+
+struct cu
+{
+  struct cu *next;              // For compatibility with C level.
+                                // xxx will probably go away eventually
+  struct cu_head const *head;
+  uint64_t cudie_offset;
+  uint64_t low_pc;              // DW_AT_low_pc value of CU DIE, -1 if not present.
+  struct ref stmt_list;
+  struct addr_record die_addrs; // Addresses where DIEs begin in this CU.
+  struct ref_record die_refs;   // DIE references into other CUs from this CU.
+  struct ref_record loc_refs;   // references into .debug_loc from this CU.
+  struct ref_record range_refs; // references into .debug_ranges from this CU.
+  struct ref_record decl_file_refs;  // values of DW_AT_decl_file in this CU.
+  bool has_arange;              // Whether we saw arange section pointing at this CU.
+  bool has_pubnames;            // Likewise for pubnames.
+  bool has_pubtypes;            // Likewise for pubtypes.
+};
+
 /** The pass for reading basic .debug_info data -- the layout of
     sections and their headers.  */
 class read_cu_headers
index 182f6d3fe3613697e4d49a56537632b74afd77be..c64140323a350290876da4a09fc8b44e13f19992 100644 (file)
    Network licensing program, please visit www.openinventionnetwork.com
    <http://www.openinventionnetwork.com>.  */
 
-#include "low.h"
 #include "checks.hh"
 #include "sections.ii"
 #include "check_debug_info.ii"
 #include "messages.h"
 #include "coverage.hh"
 
+struct section_coverage
+{
+  struct sec *sec;
+  struct coverage cov;
+  bool hit; /* true if COV is not pristine.  */
+  bool warn; /* dwarflint should emit a warning if a coverage
+               appears in this section */
+};
+
+struct coverage_map
+{
+  struct elf_file *elf;
+  struct section_coverage *scos;
+  size_t size;
+  size_t alloc;
+  bool allow_overlap;
+};
+
 class check_debug_ranges
   : public check<check_debug_ranges>
 {
similarity index 97%
rename from dwarflint/low.c
rename to dwarflint/low.cc
index 49cf303a56fcac8901a91785e8b9a8d2d0cb784f..34dd76e7f7795cf6042cb5de194eebbd333606ff 100644 (file)
@@ -1,5 +1,5 @@
 /* Pedantic checking of DWARF files
-   Copyright (C) 2008,2009,2010 Red Hat, Inc.
+   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
index 14728a6b4be6f494309580bedd179260f45f370f..7606557b397cc546d183ae02d95c2213f065a1e5 100644 (file)
@@ -28,8 +28,6 @@
 
 #include "../libdw/libdw.h"
 #include "../libebl/libebl.h"
-#include "coverage.h"
-#include "addr-record.h"
 #include "reloc.h"
 
 #ifdef __cplusplus
@@ -76,56 +74,6 @@ extern "C"
   extern bool supported_version (unsigned version,
                                 size_t num_supported, struct where *where, ...);
 
-  struct section_coverage
-  {
-    struct sec *sec;
-    struct coverage cov;
-    bool hit; /* true if COV is not pristine.  */
-    bool warn; /* dwarflint should emit a warning if a coverage
-                 appears in this section */
-  };
-
-  struct coverage_map
-  {
-    struct elf_file *elf;
-    struct section_coverage *scos;
-    size_t size;
-    size_t alloc;
-    bool allow_overlap;
-  };
-
-  struct cu_head
-  {
-    uint64_t offset;
-    Dwarf_Off size;               // Size of this CU.
-    Dwarf_Off head_size;          // Size from begin to 1st byte of CU.
-    Dwarf_Off total_size;         // size + head_size
-
-    int offset_size;             // Offset size in this CU.
-    struct where where;           // Where was this section defined.
-    Dwarf_Off abbrev_offset;      // Abbreviation section that this CU uses.
-    int version;                  // CU version
-    int address_size;             // Address size in bytes on the target machine.
-  };
-
-  struct cu
-  {
-    struct cu *next;              // For compatibility with C level.
-                                  // xxx will probably go away eventually
-    struct cu_head const *head;
-    uint64_t cudie_offset;
-    uint64_t low_pc;              // DW_AT_low_pc value of CU DIE, -1 if not present.
-    struct ref stmt_list;
-    struct addr_record die_addrs; // Addresses where DIEs begin in this CU.
-    struct ref_record die_refs;   // DIE references into other CUs from this CU.
-    struct ref_record loc_refs;   // references into .debug_loc from this CU.
-    struct ref_record range_refs; // references into .debug_ranges from this CU.
-    struct ref_record decl_file_refs;  // values of DW_AT_decl_file in this CU.
-    bool has_arange;              // Whether we saw arange section pointing at this CU.
-    bool has_pubnames;            // Likewise for pubnames.
-    bool has_pubtypes;            // Likewise for pubtypes.
-  };
-
 #ifdef __cplusplus
 }
 #endif
index 392eb71de0adefdad6bb05e43289ca59d9ffe467..53510a75a7b3ba378cdcf78c677656528c3343f5 100644 (file)
 // xxx drop as soon as not necessary
 #define __STDC_FORMAT_MACROS
 
+#include "low.h"
 #include "reloc.h"
 #include "messages.h"
-#include "low.h"
+#include "misc.h"
 #include "readctx.h"
 
 #include <sstream>
index 1e07987eeafa6aa0068e106ef4d5086a8f3c9e77..201dac7fccd4f83141ae04424d247b3531027c22 100644 (file)
@@ -34,6 +34,7 @@
 #include "sections.hh"
 #include "messages.h"
 #include "pri.hh"
+#include "misc.h"
 
 checkdescriptor const *
 load_sections::descriptor ()