]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Merge from mainline:
authorDaniel Jacobowitz <drow@false.org>
Tue, 30 Jul 2002 18:18:09 +0000 (18:18 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 30 Jul 2002 18:18:09 +0000 (18:18 +0000)
        2002-07-30  Jakub Jelinek  <jakub@redhat.com>
        * readelf.c (OPTION_DEBUG_DUMP): Define.
        (options): Use it.
        (usage): Update help.
        (parse_args): Handle --debug-dump separately from -w.
        * doc/binutils.texi (readelf): Update documentation.

binutils/ChangeLog
binutils/doc/binutils.texi
binutils/readelf.c

index cc142094e8a09aae829d5202bad755ec612588e6..f730e0cde294c36add4c348e8e0e215645aacb88 100644 (file)
@@ -1,3 +1,13 @@
+2002-07-30  Daniel Jacobowitz  <drow@mvista.com>
+
+       Merge from mainline:
+       2002-07-30  Jakub Jelinek  <jakub@redhat.com>
+       * readelf.c (OPTION_DEBUG_DUMP): Define.
+       (options): Use it.
+       (usage): Update help.
+       (parse_args): Handle --debug-dump separately from -w.
+       * doc/binutils.texi (readelf): Update documentation.
+
 2002-07-25  Nick Clifton  <nickc@redhat.com>
 
        * po/es.po: Updated Spanish translation.
index 7d7dda1e0e55063f2f7b761861f7aa68c85a8787..3006d9e60b514956f72ab0ea5cd32b6865816168 100644 (file)
@@ -2864,7 +2864,7 @@ readelf [@option{-a}|@option{--all}]
         [@option{-V}|@option{--version-info}]
         [@option{-D}|@option{--use-dynamic}]
         [@option{-x} <number>|@option{--hex-dump=}<number>]
-        [@option{-w[liaprmfs]}|@option{--debug-dump}[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str]]
+        [@option{-w[liaprmfFso]}|@option{--debug-dump}[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str,=loc]]
         [@option{-histogram}]
         [@option{-v}|@option{--version}]
         [@option{-W}|@option{--wide}]
@@ -2966,8 +2966,8 @@ symbols section.
 @itemx --hex-dump=<number>
 Displays the contents of the indicated section as a hexadecimal dump.
 
-@item -w[liaprmfs]
-@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str]
+@item -w[liaprmfFso]
+@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str,=loc]
 Displays the contents of the debug sections in the file, if any are
 present.  If one of the optional letters or words follows the switch
 then only data found in those specific sections will be dumped.
index 9c15d9f25ccf8c8f95455674e6b37c89043c5c80..e053cbaecb1328557d3bfddf9b9441d1aaf565fa 100644 (file)
@@ -2241,6 +2241,8 @@ get_section_type_name (sh_type)
     }
 }
 
+#define OPTION_DEBUG_DUMP      512
+
 struct option options [] =
 {
   {"all",              no_argument, 0, 'a'},
@@ -2260,7 +2262,7 @@ struct option options [] =
   {"version-info",     no_argument, 0, 'V'},
   {"use-dynamic",      no_argument, 0, 'D'},
   {"hex-dump",         required_argument, 0, 'x'},
-  {"debug-dump",       optional_argument, 0, 'w'},
+  {"debug-dump",       optional_argument, 0, OPTION_DEBUG_DUMP},
   {"unwind",          no_argument, 0, 'u'},
 #ifdef SUPPORT_DISASSEMBLY
   {"instruction-dump", required_argument, 0, 'i'},
@@ -2295,7 +2297,8 @@ usage ()
   -A --arch-specific     Display architecture specific information (if any).\n\
   -D --use-dynamic       Use the dynamic section info when displaying symbols\n\
   -x --hex-dump=<number> Dump the contents of section <number>\n\
-  -w --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str,=loc]\n\
+  -w[liaprmfFso] or\n\
+  --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str,=loc]\n\
                          Display the contents of DWARF2 debug sections\n"));
 #ifdef SUPPORT_DISASSEMBLY
   fprintf (stdout, _("\
@@ -2493,6 +2496,88 @@ parse_args (argc, argv)
                  }
            }
          break;
+       case OPTION_DEBUG_DUMP:
+         do_dump ++;
+         if (optarg == 0)
+           do_debugging = 1;
+         else
+           {
+             const char *debug_dump_opt[]
+               = { "line", "info", "abbrev", "pubnames", "ranges",
+                   "macro", "frames", "frames-interp", "str", "loc", NULL };
+             unsigned int index;
+             const char *p;
+
+             do_debugging = 0;
+
+             p = optarg;
+             while (*p)
+               {
+                 for (index = 0; debug_dump_opt[index]; index++)
+                   {
+                     size_t len = strlen (debug_dump_opt[index]);
+
+                     if (strncmp (p, debug_dump_opt[index], len) == 0
+                         && (p[len] == ',' || p[len] == '\0'))
+                       {
+                         switch (p[0])
+                           {
+                           case 'i':
+                             do_debug_info = 1;
+                             break;
+
+                           case 'a':
+                             do_debug_abbrevs = 1;
+                             break;
+
+                           case 'l':
+                             if (p[1] == 'i')
+                               do_debug_lines = 1;
+                             else
+                               do_debug_loc = 1;
+                             break;
+
+                           case 'p':
+                             do_debug_pubnames = 1;
+                             break;
+
+                           case 'r':
+                             do_debug_aranges = 1;
+                             break;
+
+                           case 'f':
+                             if (len > 6)
+                               do_debug_frames_interp = 1;
+                             do_debug_frames = 1;
+                             break;
+
+                           case 'm':
+                             do_debug_macinfo = 1;
+                             break;
+
+                           case 's':
+                             do_debug_str = 1;
+                             break;
+                           }
+
+                         p += len;
+                         break;
+                       }
+                   }
+
+                 if (debug_dump_opt[index] == NULL)
+                   {
+                     warn (_("Unrecognized debug option '%s'\n"), p);
+                     p = strchr (p, ',');
+                     if (p == NULL)
+                       break;
+                   }
+
+                 if (*p == ',')
+                   p++;
+               }
+           }
+         break;
 #ifdef SUPPORT_DISASSEMBLY
        case 'i':
          do_dump ++;