summaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-04-28 17:23:14 +0000
committerTom Tromey <tromey@redhat.com>2011-04-28 17:23:14 +0000
commit6379328b5621ca0b59ed9286f3bea7e841bb9f35 (patch)
tree73a69be2aeb0a0fc9067207f38641d8055145edf /binutils/readelf.c
parent8cbdc88f8974b97d435e702172e2ba06728a875a (diff)
downloadbinutils-redhat-6379328b5621ca0b59ed9286f3bea7e841bb9f35.tar.gz
* NEWS: Add note about --dwarf-depth, --dwarf-start, and
dwarf-mode.el. * objdump.c (suppress_bfd_header): New global. (usage): Update. (OPTION_DWARF_DEPTH, OPTION_DWARF_START): New constants. (options): Add dwarf-depth and dwarf-start entries. (dump_bfd): Use suppress_bfd_header. (main): Handle OPTION_DWARF_START, OPTION_DWARF_DEPTH. * doc/binutils.texi (objcopy): Document --dwarf-depth and --dwarf-start. (readelf): Likewise. * dwarf-mode.el: New file. * dwarf.c (dwarf_cutoff_level, dwarf_start_die): New globals. (read_and_display_attr_value): Also check debug_info_p. (process_debug_info): Handle dwarf_start_die and dwarf_cutoff_level. * dwarf.h (dwarf_cutoff_level, dwarf_start_die): Declare. * readelf.c (usage): Update. (OPTION_DWARF_DEPTH): New macro. (OPTION_DWARF_START): Likewise. (options): Add dwarf-depth and dwarf-start entries. (parse_args): Handle OPTION_DWARF_START and OPTION_DWARF_DEPTH. testsuite * binutils-all/objdump.W: Correct output.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index c4df8d9c48..6c8b9668d2 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -3073,6 +3073,8 @@ get_section_type_name (unsigned int sh_type)
#define OPTION_DEBUG_DUMP 512
#define OPTION_DYN_SYMS 513
+#define OPTION_DWARF_DEPTH 514
+#define OPTION_DWARF_START 515
static struct option options[] =
{
@@ -3106,6 +3108,9 @@ static struct option options[] =
#endif
{"debug-dump", optional_argument, 0, OPTION_DEBUG_DUMP},
+ {"dwarf-depth", required_argument, 0, OPTION_DWARF_DEPTH},
+ {"dwarf-start", required_argument, 0, OPTION_DWARF_START},
+
{"version", no_argument, 0, 'v'},
{"wide", no_argument, 0, 'W'},
{"help", no_argument, 0, 'H'},
@@ -3149,6 +3154,10 @@ usage (FILE * stream)
=frames-interp,=str,=loc,=Ranges,=pubtypes,\n\
=gdb_index,=trace_info,=trace_abbrev,=trace_aranges]\n\
Display the contents of DWARF2 debug sections\n"));
+ fprintf (stream, _("\
+ --dwarf-depth=N Do not display DIEs at depth N or greater\n\
+ --dwarf-start=N Display DIEs starting with N, at the same depth\n\
+ or deeper\n"));
#ifdef SUPPORT_DISASSEMBLY
fprintf (stream, _("\
-i --instruction-dump=<number|name>\n\
@@ -3355,6 +3364,20 @@ parse_args (int argc, char ** argv)
dwarf_select_sections_by_names (optarg);
}
break;
+ case OPTION_DWARF_DEPTH:
+ {
+ char *cp;
+
+ dwarf_cutoff_level = strtoul (optarg, & cp, 0);
+ }
+ break;
+ case OPTION_DWARF_START:
+ {
+ char *cp;
+
+ dwarf_start_die = strtoul (optarg, & cp, 0);
+ }
+ break;
case OPTION_DYN_SYMS:
do_dyn_syms++;
break;