This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RFA: fix DWARF debugging output with --dwarf-depth
- From: Tom Tromey <tromey at redhat dot com>
- To: Binutils Development <binutils at sourceware dot org>
- Date: Wed, 27 Mar 2013 07:39:04 -0600
- Subject: RFA: fix DWARF debugging output with --dwarf-depth
Right now, if I use objdump --dwarf-depth=1, I see output like this:
Compilation Unit @ offset 0x0:
Length: 0x51 (32-bit)
Version: 2
Abbrev Offset: 0x0
Pointer Size: 8
<0><b>: Abbrev Number: 2 (DW_TAG_compile_unit)
<1><c>: ...
<2><2b>: Abbrev Number: 0
<1><54>: Abbrev Number: 0
Those "Abbrev Number: 0" lines are spurious and clutter up the M-x
dwarf-browse buffer.
This patch fixes the problem by changing the code that prints this to
respect dwarf_cutoff_level.
Built and tested on x86-64 Fedora 18.
Ok?
Tom
2013-03-27 Tom Tromey <tromey@redhat.com>
* dwarf.c (process_debug_info): Check dwarf_cutoff_level.
---
binutils/ChangeLog | 4 ++++
binutils/dwarf.c | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 1787e7e..45ba792 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -2374,7 +2374,9 @@ process_debug_info (struct dwarf_section *section,
break;
}
- if (!do_loc && die_offset >= dwarf_start_die)
+ if (!do_loc && die_offset >= dwarf_start_die
+ && (dwarf_cutoff_level == -1
+ || level < dwarf_cutoff_level))
printf (_(" <%d><%lx>: Abbrev Number: 0\n"),
level, die_offset);
--
1.8.1.4