* objdump.c: New command line option --debugging-tags.

* doc/binutils.texi: Document new command line option.
* prdbg.c: Code to print the debug info as tags compatible with ctags.
* budbg.h: Adjust prototype.
* NEWS: Mention new switch
This commit is contained in:
Nick Clifton 2003-07-22 13:33:32 +00:00
parent aef9bcd2e7
commit 51cdc6e056
6 changed files with 1098 additions and 14 deletions

View File

@ -1,3 +1,12 @@
2003-07-22 Salvador Eduardo Tropea <set@computer.org>
* objdump.c: New command line option --debugging-tags.
* doc/binutils.texi: Document new command line option.
* prdbg.c: Code to print the debug info as tags compatible
with ctags.
* budbg.h: Adjust prototype.
* NEWS: Mention new switch
2003-07-18 Nick Clifton <nickc@redhat.com>
* objdump.c (main) :Accept multiple -M switch.

View File

@ -1,5 +1,8 @@
-*- text -*-
* objdump now accepts --debugging-tags to print the debug information in a
format compatible with ctags tool.
* objcopy and strip now accept --only-keep-debug to create a file containing
those sections that would be stripped out by --strip-debug. The idea is that
this can be used in conjunction with the --add-gnu-debuglink switch to create

View File

@ -1,5 +1,5 @@
/* budbg.c -- Interfaces to the generic debugging information routines.
Copyright 1995, 1996, 2002 Free Software Foundation, Inc.
Copyright 1995, 1996, 2002, 2003 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
@ -26,13 +26,13 @@
/* Routine used to read generic debugging information. */
extern PTR read_debugging_info
extern PTR read_debugging_info
PARAMS ((bfd *, asymbol **, long));
/* Routine used to print generic debugging information. */
extern bfd_boolean print_debugging_info
PARAMS ((FILE *, PTR));
(FILE *, void *, bfd *, asymbol **, void *, bfd_boolean);
/* Routines used to read and write stabs information. */

View File

@ -1435,6 +1435,7 @@ objdump [@option{-a}|@option{--archive-headers}]
[@option{-f}|@option{--file-headers}]
[@option{--file-start-context}]
[@option{-g}|@option{--debugging}]
[@option{-e}|@option{--debugging-tags}]
[@option{-h}|@option{--section-headers}|@option{--headers}]
[@option{-i}|@option{--info}]
[@option{-j} @var{section}|@option{--section=}@var{section}]
@ -1480,7 +1481,7 @@ object files.
The long and short forms of options, shown here as alternatives, are
equivalent. At least one option from the list
@option{-a,-d,-D,-f,-g,-G,-h,-H,-p,-r,-R,-S,-t,-T,-V,-x} must be given.
@option{-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-S,-t,-T,-V,-x} must be given.
@table @env
@item -a
@ -1536,6 +1537,11 @@ Only certain types of debugging information have been implemented.
Some other types are supported by @command{readelf -w}.
@xref{readelf}.
@item -e
@itemx --debugging-tags
Like @option{-g}, but the information is generated in a format compatible
with ctags tool.
@item -d
@itemx --disassemble
@cindex disassembling object code

View File

@ -74,6 +74,7 @@ static int wide_output; /* -w */
static bfd_vma start_address = (bfd_vma) -1; /* --start-address */
static bfd_vma stop_address = (bfd_vma) -1; /* --stop-address */
static int dump_debugging; /* --debugging */
static int dump_debugging_tags; /* --debugging-tags */
static bfd_vma adjust_section_vma = 0; /* --adjust-vma */
static int file_start_context = 0; /* --file-start-context */
@ -208,6 +209,7 @@ usage (stream, status)
-S, --source Intermix source code with disassembly\n\
-s, --full-contents Display the full contents of all sections requested\n\
-g, --debugging Display debug information in object file\n\
-e, --debugging-tags Display debug information using ctags style\n\
-G, --stabs Display (in raw form) any STABS info in the file\n\
-t, --syms Display the contents of the symbol table(s)\n\
-T, --dynamic-syms Display the contents of the dynamic symbol table\n\
@ -266,6 +268,7 @@ static struct option long_options[]=
{"architecture", required_argument, NULL, 'm'},
{"archive-headers", no_argument, NULL, 'a'},
{"debugging", no_argument, NULL, 'g'},
{"debugging-tags", no_argument, NULL, 'e'},
{"demangle", optional_argument, NULL, 'C'},
{"disassemble", no_argument, NULL, 'd'},
{"disassemble-all", no_argument, NULL, 'D'},
@ -2068,15 +2071,17 @@ dump_bfd (abfd)
}
}
printf (_("\n%s: file format %s\n"), bfd_get_filename (abfd),
abfd->xvec->name);
if (! dump_debugging_tags)
printf (_("\n%s: file format %s\n"), bfd_get_filename (abfd),
abfd->xvec->name);
if (dump_ar_hdrs)
print_arelt_descr (stdout, abfd, TRUE);
if (dump_file_header)
dump_bfd_header (abfd);
if (dump_private_headers)
dump_bfd_private_header (abfd);
putchar ('\n');
if (! dump_debugging_tags)
putchar ('\n');
if (dump_section_headers)
dump_headers (abfd);
@ -2106,7 +2111,8 @@ dump_bfd (abfd)
dhandle = read_debugging_info (abfd, syms, symcount);
if (dhandle != NULL)
{
if (! print_debugging_info (stdout, dhandle))
if (! print_debugging_info (stdout, dhandle, abfd, syms, demangle,
dump_debugging_tags ? TRUE : FALSE))
{
non_fatal (_("%s: printing debugging information failed"),
bfd_get_filename (abfd));
@ -2648,7 +2654,7 @@ main (argc, argv)
bfd_init ();
set_default_bfd_target ();
while ((c = getopt_long (argc, argv, "pib:m:M:VvCdDlfaHhrRtTxsSj:wE:zgG",
while ((c = getopt_long (argc, argv, "pib:m:M:VvCdDlfaHhrRtTxsSj:wE:zgeG",
long_options, (int *) 0))
!= EOF)
{
@ -2785,6 +2791,12 @@ main (argc, argv)
dump_debugging = 1;
seenflag = TRUE;
break;
case 'e':
dump_debugging = 1;
dump_debugging_tags = 1;
do_demangle = TRUE;
seenflag = TRUE;
break;
case 'G':
dump_stab_section_info = TRUE;
seenflag = TRUE;

File diff suppressed because it is too large Load Diff