diff options
| author | Roland McGrath <[email protected]> | 2009-08-21 17:41:16 -0700 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2009-08-21 17:41:16 -0700 |
| commit | 20f5c57ec29c8d95d4640b4baf74a4b1f0a55d63 (patch) | |
| tree | 9a3e3135b3a66f140a757fbc04b178668fb0ed84 /tests | |
| parent | 9a2fe33ccf42ba9f2317414ea67b21037282c073 (diff) | |
Add --silent option to dwarf-print et al.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ChangeLog | 4 | ||||
| -rw-r--r-- | tests/print-die.hh | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index 584569cc..3a81522a 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2009-08-21 Roland McGrath <[email protected]> + + * print-die.hh (print_die_main, print_file): Add --silent option. + 2009-08-19 Roland McGrath <[email protected]> * print-die.hh: Handle --norefs, --dump-refs. diff --git a/tests/print-die.hh b/tests/print-die.hh index d946a9eb..76f160b4 100644 --- a/tests/print-die.hh +++ b/tests/print-die.hh @@ -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); |
