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 \
/* 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
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>
{
/* 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
#include "../libdw/libdw.h"
#include "../libebl/libebl.h"
-#include "coverage.h"
-#include "addr-record.h"
#include "reloc.h"
#ifdef __cplusplus
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
// 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>
#include "sections.hh"
#include "messages.h"
#include "pri.hh"
+#include "misc.h"
checkdescriptor const *
load_sections::descriptor ()