]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: More moving stuff around
authorPetr Machata <pmachata@redhat.com>
Tue, 21 Sep 2010 20:29:05 +0000 (22:29 +0200)
committerPetr Machata <pmachata@redhat.com>
Tue, 21 Sep 2010 20:29:05 +0000 (22:29 +0200)
12 files changed:
dwarflint/check_debug_abbrev.cc
dwarflint/check_debug_abbrev.hh
dwarflint/check_debug_info.cc
dwarflint/check_debug_line.cc
dwarflint/check_debug_pub.cc
dwarflint/check_expected_trees.cc
dwarflint/low.c
dwarflint/low.h
dwarflint/main.cc
dwarflint/reloc.cc
dwarflint/tables.cc
dwarflint/tables.h

index 8cff94e230a263c04eaf5b201099a2fd39880a8b..8e6da49908aad758342a0a715bc21f1ff5565535 100644 (file)
@@ -33,6 +33,8 @@
 #include "tables.hh"
 #include "sections.hh"
 #include "checked_read.h"
+#include "messages.h"
+#include "tables.h"
 
 #include <dwarf.h>
 #include <sstream>
@@ -413,7 +415,7 @@ namespace
                    << "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))
@@ -524,14 +526,17 @@ check_debug_abbrev::~check_debug_abbrev ()
     }
 }
 
-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;
+    }
 }
-
index e9bb451c2ff0486452a367d5fdc8c515dba27f20..dbd8eff6f1a42dd44c8570d519b2d1bf496ca5ac 100644 (file)
@@ -48,6 +48,8 @@ public:
   ~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
index e6e91aea7d79ae8a9f5a5dfe6e2c5b298bef1a47..48f58199abefc697f94674118a65a0141a214516 100644 (file)
@@ -33,6 +33,7 @@
 #include "../libdw/dwarf.h"
 
 #include "messages.h"
+#include "tables.h"
 #include "pri.hh"
 #include "option.hh"
 #include "sections.hh"
@@ -638,7 +639,7 @@ namespace
                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))
index a4ea2551420ef991bbdd2868790586f325730dd4..046364e28782ac9fdd26bdc7864008094f9abe67 100644 (file)
@@ -28,6 +28,7 @@
 #include "sections.hh"
 #include "pri.hh"
 #include "checked_read.h"
+#include "messages.h"
 
 #include <dwarf.h>
 #include "../libdw/known-dwarf.h"
index 2a7c0dd3faa2eac497d5c0f2d3dfa5012cb30bc0..e649888d1a1798207ec00e4849df90c49e8213c0 100644 (file)
@@ -28,6 +28,7 @@
 #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)
index c90a488dc94522dfa932f91e852cdce6bf232df7..0f8f369f50a7ffc1382d2f3fc0b669399fe7f53c 100644 (file)
@@ -33,6 +33,7 @@
 #include "../src/dwarfstrings.h"
 #include "../libdw/c++/dwarf-knowledge.cc"
 #include "pri.hh"
+#include "messages.h"
 
 using elfutils::dwarf;
 
index da078859e605c0402edc815bdde4ea43e9813c1f..49cf303a56fcac8901a91785e8b9a8d2d0cb784f 100644 (file)
 # 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)
@@ -60,21 +43,6 @@ necessary_alignment (uint64_t start, uint64_t length, 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, ...)
index 0527c5c2de458ac547705bdbca8fd63ca6a8855c..76da44a1e7f3d320f704a247693e9ad5d509fbbf 100644 (file)
 #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"
@@ -115,11 +112,6 @@ 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;
index 53a61a44496dee1c8624230b1f39e106f5f86305..823022af30a024dad4b804cbc49d06325e0ab3ec 100644 (file)
@@ -38,6 +38,7 @@
 #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;
index df7164ead61b8889f3c85af2777e07cd43572ee0..392eb71de0adefdad6bb05e43289ca59d9ffe467 100644 (file)
@@ -29,6 +29,8 @@
 #include "reloc.h"
 #include "messages.h"
 #include "low.h"
+#include "readctx.h"
+
 #include <sstream>
 #include <libebl.h>
 #include <cassert>
index 4eaff7d81f7fc41bb1869fb7bd2be1c1408637cb..82d4dd4b5fbc84d5f3bcafb90d73c429aef8b05d 100644 (file)
@@ -425,6 +425,17 @@ dwver_form_allowed_in (dwarf_version const *ver, int attr, int form, int tag)
   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)
index 7bfe2d93272e72222a50bab6dfa7834de63fa7b9..0aa5384eb51ed904db8ba0d1613e75ab86e0df3d 100644 (file)
@@ -1,6 +1,6 @@
 /* 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
@@ -49,6 +49,8 @@ extern "C"
 
   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