]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - binutils/readelf.c
* NEWS: Add note about --dwarf-depth, --dwarf-start, and
[thirdparty/binutils-gdb.git] / binutils / readelf.c
index c4df8d9c48aeaa7487b8d5e0b12495f8d979df84..6c8b9668d2c3ad9860ae39dcb90798259f7b2413 100644 (file)
@@ -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;