]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add --silent option to dwarf-print et al.
authorRoland McGrath <roland@redhat.com>
Sat, 22 Aug 2009 00:41:16 +0000 (17:41 -0700)
committerRoland McGrath <roland@redhat.com>
Sat, 22 Aug 2009 00:41:16 +0000 (17:41 -0700)
tests/ChangeLog
tests/print-die.hh

index 584569cc2cac79a954ced20dcdf6923d1cbde5d4..3a81522a78a57ee9b2b6a4af645d845411a65a73 100644 (file)
@@ -1,3 +1,7 @@
+2009-08-21  Roland McGrath  <roland@redhat.com>
+
+       * print-die.hh (print_die_main, print_file): Add --silent option.
+
 2009-08-19  Roland McGrath  <roland@redhat.com>
 
        * print-die.hh: Handle --norefs, --dump-refs.
index d946a9eb6955ca043df0da0bebee2bae09dd39e3..76f160b4453d40af5a022e6caa6858b88ec51adf 100644 (file)
@@ -41,6 +41,7 @@ static bool print_offset;
 static bool sort_attrs;
 static bool elide_refs;
 static bool dump_refs;
+static bool no_print;
 
 static enum { copy_none, copy_edit, copy_output } make_copy;
 
@@ -99,6 +100,13 @@ print_die_main (int &argc, char **&argv, unsigned int &depth)
       ++argv;
     }
 
+  if (argc > 1 && !strcmp (argv[1], "--silent"))
+    {
+      no_print = true;
+      --argc;
+      ++argv;
+    }
+
   depth = 0;
   if (argc > 1 && sscanf (argv[1], "--depth=%u", &depth) == 1)
     {
@@ -274,6 +282,9 @@ template<typename file>
 static void
 print_file (const file &dw, const unsigned int limit)
 {
+  if (no_print)
+    return;
+
   for (typename file::compile_units::const_iterator i
         = dw.compile_units ().begin (); i != dw.compile_units ().end (); ++i)
     print_cu<file> (*i, limit);