]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add --ref option that turns on reference reporting during .debug_ranges validation
authorPetr Machata <pmachata@redhat.com>
Wed, 4 Feb 2009 16:29:39 +0000 (17:29 +0100)
committerPetr Machata <pmachata@redhat.com>
Wed, 4 Feb 2009 16:29:39 +0000 (17:29 +0100)
* ... and make reference reporting off by default.  Previous setting was
  overly verbose, without really being useful.

src/dwarflint.c

index 6c92d667b99e8d8599237a2ea66a4e65dd999e32..0cf29787b60f49f41a1f6d756e644c3e918efc9c 100644 (file)
@@ -56,6 +56,7 @@ const char *argp_program_bug_address = PACKAGE_BUGREPORT;
 #define ARGP_strict    300
 #define ARGP_gnu       301
 #define ARGP_tolerant  302
+#define ARGP_ref        303
 
 /* Definitions of arguments for argp functions.  */
 static const struct argp_option options[] =
@@ -70,6 +71,9 @@ static const struct argp_option options[] =
 broken in certain ways"), 0 },
   { "tolerant", ARGP_tolerant, NULL, 0,
     N_("Don't output certain common error messages"), 0 },
+  { "ref", ARGP_ref, NULL, 0,
+    N_("When validating .debug_loc and .debug_ranges, display information about \
+the DIE referring to the entry in consideration"), 0 },
   { NULL, 0, NULL, 0, NULL, 0 }
 };
 
@@ -222,6 +226,7 @@ static bool be_quiet;
 static bool be_strict = false; /* --strict */
 static bool be_gnu = false; /* --gnu */
 static bool be_tolerant = false; /* --tolerant */
+static bool show_refs = false; /* --ref */
 
 int
 main (int argc, char *argv[])
@@ -336,6 +341,10 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
       be_tolerant = true;
       break;
 
+    case ARGP_ref:
+      show_refs = true;
+      break;
+
     case 'i':
       tolerate_nodebug = true;
       break;
@@ -3239,8 +3248,7 @@ check_loc_or_range_ref (struct read_ctx *ctx,
   uint64_t base = cu->base;
   while (!read_ctx_eof (ctx))
     {
-      struct where where = WHERE (sec, NULL);
-      where.ref = wh;
+      struct where where = WHERE (sec, show_refs ? wh : NULL);
       where_reset_1 (&where, read_ctx_get_offset (ctx));
 
 #define HAVE_OVERLAP                                           \