This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Makes objdump --dwarf as flexible as readelf --debug-dump
- From: Cary Coutant <ccoutant at google dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 20 Feb 2009 11:03:35 -0800
- Subject: Re: Makes objdump --dwarf as flexible as readelf --debug-dump
- References: <20090203165747.GA15251@ulanbator.act-europe.fr>
> * objdump.c (usage): Update documentation for -W/--dwarf.
> (enum option_values): Add OPTION_DWARF.
> (long_options): --dwarf can accept arguments.
> (dump_dwarf_section): Also check enabled field.
> (main): Option -W can accept arguments, code moved to
> dwarf.c and call dwarf_select_sections_all instead.
> * readelf.c (process_section_headers): Remove do_debug_lines_decoded.
> (parse_args): Move code to...
> * dwarf.c (dwarf_select_sections_by_letters,
> dwarf_select_sections_by_names): : ...here (new functions).
> (do_debug_lines_decoded): Remove and replaced by ...
> (FLAG_DEBUG_LINES_RAW, FLAG_DEBUG_LINES_DECODED): ... new macros.
> (display_debug_lines): Adjust for previous change.
> (dwarf_select_sections_all): New function.
> (debug_displays): Add initializer for enabled field.
> * dwarf.h (do_debug_lines_decoded): Remove.
> Add prototypes for the new functions.
> (struct dwarf_section_display): Add enabled field.
This patch introduced a small breakage in readelf -- the -w option no
longer dumps line table sections at all, since neither
FLAG_DEBUG_LINES_RAW nor FLAG_DEBUG_LINES_DECODED is set. The patch
below fixes that.
OK?
-cary
* readelf.c (parse_args): Select all sections explicitly for -w.
Index: readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.437
diff -u -p -r1.437 readelf.c
--- readelf.c 9 Feb 2009 09:14:15 -0000 1.437
+++ readelf.c 20 Feb 2009 19:01:08 -0000
@@ -3037,7 +3037,10 @@ parse_args (int argc, char **argv)
case 'w':
do_dump++;
if (optarg == 0)
- do_debugging = 1;
+ {
+ do_debugging = 1;
+ dwarf_select_sections_all ();
+ }
else
{
do_debugging = 0;