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 \
<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)
#include "sections.hh"
#include "checked_read.hh"
#include "messages.hh"
-#include "misc.h"
+#include "misc.hh"
#include <dwarf.h>
#include <sstream>
#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 ()
/* 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
#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"
#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 ()
#include "pri.hh"
#include "checked_read.hh"
#include "messages.hh"
+#include "misc.hh"
#include <dwarf.h>
#include "../libdw/known-dwarf.h"
#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>
#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
#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)
#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
#include "coverage.hh"
#include "pri.hh"
#include "check_debug_loc_range.hh"
-#include "misc.h"
+#include "misc.hh"
using elfutils::dwarf;
#endif
#include "coverage.hh"
+#include "misc.hh"
#include "pri.hh"
-#include "misc.h"
#include <stdbool.h>
#include <assert.h>
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*/
#include <iostream>
#include <sstream>
-#include "low.h"
#include "dwarflint.hh"
#include "readctx.h"
#include "checks.hh"
<http://www.openinventionnetwork.com>. */
#include "messages.hh"
-#include "misc.h"
+#include "misc.hh"
#include "coverage.hh"
#include <vector>
# include <config.h>
#endif
-#include "low.h"
+#include "misc.hh"
#include "messages.hh"
#include <stdarg.h>
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
#include <libdw.h>
#include <string>
+#define PRI_NOT_ENOUGH ": not enough data for %s.\n"
+
namespace pri
{
class pribase
<http://www.openinventionnetwork.com>. */
#include "readctx.h"
-#include "low.h"
#include "../libdw/dwarf.h"
#include <stdlib.h>
// 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>
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);
#include "sections.hh"
#include "messages.hh"
#include "pri.hh"
-#include "misc.h"
+#include "misc.hh"
checkdescriptor const *
load_sections::descriptor ()
/* 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
#define DWARFLINT_SECTIONS_HH
#include "checks.hh"
-#include "low.h"
+#include "elf_file.hh"
class load_sections
: public check<load_sections>