+2008-06-12 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/6483
+ * objdump.c (dump_bfd): If the -g option found no STABS or IEEE
+ debug information to display, try dumping DWARF information
+ instead.
+ * rddbg.c (read_debugging_info): Add a parameter to suppress the
+ display of a warning message when no debug information is found.
+ * budbg.h (read_debugging_info): Update prototype.
+ * objcopy.c (copy_object): Continue to allow read_debugging_info
+ to produce warning messages.
+ * doc/binutils.texi (--debugging): Document new behaviour of the
+ -g/--debugging option.
+
2008-06-10 Ben Elliston <bje@gnu.org>
* MAINTAINERS: Remove myself as m68k maintainer.
/* budbg.c -- Interfaces to the generic debugging information routines.
- Copyright 1995, 1996, 2002, 2003, 2007 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 2002, 2003, 2007, 2008 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
/* Routine used to read generic debugging information. */
-extern void *read_debugging_info (bfd *, asymbol **, long);
+extern void *read_debugging_info (bfd *, asymbol **, long, bfd_boolean);
/* Routine used to print generic debugging information. */
@item -g
@itemx --debugging
-Display debugging information. This attempts to parse debugging
-information stored in the file and print it out using a C like syntax.
-Only certain types of debugging information have been implemented.
-Some other types are supported by @command{readelf -w}.
-@xref{readelf}.
+Display debugging information. This attempts to parse STABS and IEEE
+debugging format information stored in the file and print it out using
+a C like syntax. If neither of these formats are found this option
+falls back on the @option{-W} option to print any DWARF information in
+the file.
@item -e
@itemx --debugging-tags
have been created, but before their contents are set. */
dhandle = NULL;
if (convert_debugging)
- dhandle = read_debugging_info (ibfd, isympp, symcount);
+ dhandle = read_debugging_info (ibfd, isympp, symcount, FALSE);
if (strip_symbols == STRIP_DEBUG
|| strip_symbols == STRIP_ALL
{
void *dhandle;
- dhandle = read_debugging_info (abfd, syms, symcount);
+ dhandle = read_debugging_info (abfd, syms, symcount, TRUE);
if (dhandle != NULL)
{
if (!print_debugging_info (stdout, dhandle, abfd, syms,
exit_status = 1;
}
}
+ /* PR 6483: If there was no STABS or IEEE debug
+ info in the file, try DWARF instead. */
+ else if (! dump_dwarf_section_info)
+ {
+ dump_dwarf (abfd);
+ }
}
if (syms)
/* rddbg.c -- Read debugging information into a generic form.
- Copyright 1995, 1996, 1997, 2000, 2002, 2003, 2005, 2007
+ Copyright 1995, 1996, 1997, 2000, 2002, 2003, 2005, 2007, 2008
Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
pointer. */
void *
-read_debugging_info (bfd *abfd, asymbol **syms, long symcount)
+read_debugging_info (bfd *abfd, asymbol **syms, long symcount, bfd_boolean no_messages)
{
void *dhandle;
bfd_boolean found;
if (! found)
{
- non_fatal (_("%s: no recognized debugging information"),
- bfd_get_filename (abfd));
+ if (! no_messages)
+ non_fatal (_("%s: no recognized debugging information"),
+ bfd_get_filename (abfd));
return NULL;
}