#include "tables.hh"
#include "sections.hh"
#include "checked_read.h"
+#include "messages.h"
+#include "tables.h"
#include <dwarf.h>
#include <sstream>
<< "excessive DW_AT_sibling attribute at childless abbrev."
<< std::endl;
- switch (check_sibling_form (ver, attrib_form))
+ switch (dwver_check_sibling_form (ver, attrib_form))
{
case -1:
wr_message (where, cat (mc_die_rel, mc_impact_2))
}
}
-int
-check_sibling_form (dwarf_version_h ver, uint64_t form)
+bool
+is_location_attrib (uint64_t name)
{
- if (!dwver_form_allowed (ver, DW_AT_sibling, form))
- return -2;
- else if (form == DW_FORM_ref_addr)
- return -1;
- else
- return 0;
+ switch (name)
+ {
+ case DW_AT_location:
+ case DW_AT_frame_base:
+ case DW_AT_data_location:
+ case DW_AT_data_member_location:
+ return true;
+ default:
+ return false;
+ }
}
-
~check_debug_abbrev ();
};
-int check_sibling_form (dwarf_version_h ver, uint64_t form);
+// xxx When dwarf version objects are properly implemented, that's
+// where this should end up in.
+bool is_location_attrib (uint64_t name);
#endif//DWARFLINT_CHECK_DEBUG_ABBREV_HH
#include "../libdw/dwarf.h"
#include "messages.h"
+#include "tables.h"
#include "pri.hh"
#include "option.hh"
#include "sections.hh"
form = value;
if (it->name == DW_AT_sibling)
- switch (check_sibling_form (ver, form))
+ switch (dwver_check_sibling_form (ver, form))
{
case -1:
wr_message (where, cat (mc_die_rel, mc_impact_2))
#include "sections.hh"
#include "pri.hh"
#include "checked_read.h"
+#include "messages.h"
#include <dwarf.h>
#include "../libdw/known-dwarf.h"
#include "sections.hh"
#include "pri.hh"
#include "checked_read.h"
+#include "messages.h"
template<section_id sec_id>
check_debug_pub<sec_id>::check_debug_pub (checkstack &stack, dwarflint &lint)
#include "../src/dwarfstrings.h"
#include "../libdw/c++/dwarf-knowledge.cc"
#include "pri.hh"
+#include "messages.h"
using elfutils::dwarf;
# include <config.h>
#endif
-#include <assert.h>
-#include <error.h>
-#include <gelf.h>
-#include <inttypes.h>
-#include <libintl.h>
-#include <locale.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <system.h>
-#include <unistd.h>
-
-#include "../libdw/dwarf.h"
-#include "../libebl/libebl.h"
-#include "../src/dwarfstrings.h"
#include "low.h"
-#include "readctx.h"
-#include "tables.h"
+#include "messages.h"
+#include <stdarg.h>
bool
address_aligned (uint64_t addr, uint64_t align)
return address_aligned (start + length, align) && length < align;
}
-bool
-is_location_attrib (uint64_t name)
-{
- switch (name)
- {
- case DW_AT_location:
- case DW_AT_frame_base:
- case DW_AT_data_location:
- case DW_AT_data_member_location:
- return true;
- default:
- return false;
- }
-}
-
bool
supported_version (unsigned version,
size_t num_supported, struct where *where, ...)
#include "../libdw/libdw.h"
#include "../libebl/libebl.h"
#include "coverage.h"
-#include "messages.h"
-#include "readctx.h"
#include "addr-record.h"
#include "reloc.h"
-#include "tables.h"
#ifdef __cplusplus
extern "C"
bool allow_overlap;
};
- // xxx low-level check entry points, will go away
-
- extern int check_sibling_form (dwarf_version_h ver, uint64_t form);
- extern bool is_location_attrib (uint64_t name);
-
struct abbrev_attrib
{
struct where where;
#include "readctx.h"
#include "checks.hh"
#include "option.hh"
+#include "messages.h"
/* Messages that are accepted (and made into warning). */
struct message_criteria warning_criteria;
#include "reloc.h"
#include "messages.h"
#include "low.h"
+#include "readctx.h"
+
#include <sstream>
#include <libebl.h>
#include <cassert>
return ver->form_allowed (attr, form, tag);
}
+int
+dwver_check_sibling_form (dwarf_version_h ver, int form)
+{
+ if (!dwver_form_allowed (ver, DW_AT_sibling, form))
+ return -2;
+ else if (form == DW_FORM_ref_addr)
+ return -1;
+ else
+ return 0;
+}
+
#if 0
.at (DW_AT_abstract_origin)
/* Dwarf version tables, C binding.
- 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
bool dwver_form_allowed_in (dwarf_version_h ver, int attr,int form, int tag);
+ int dwver_check_sibling_form (dwarf_version_h ver, int form);
+
#ifdef __cplusplus
}
#endif