forked from Imagelibrary/binutils-gdb
objdump -g on gcc COFF/PE files
objdump -g can't be used much. Trying to dump PE files invariably seems to run into "debug_name_type: no current file" or similar errors, because parse_coff expects a C_FILE symbol to be the first symbol. Dumping -gstabs output works since the N_SO stab is present. Pre-setting the file name won't hurt stabs dumping. * rddbg.c (read_debugging_info): Call debug_set_filename.
This commit is contained in:
@@ -53,15 +53,18 @@ read_debugging_info (bfd *abfd, asymbol **syms, long symcount,
|
|||||||
if (dhandle == NULL)
|
if (dhandle == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (!debug_set_filename (dhandle, bfd_get_filename (abfd)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (! read_section_stabs_debugging_info (abfd, syms, symcount, dhandle,
|
if (! read_section_stabs_debugging_info (abfd, syms, symcount, dhandle,
|
||||||
&found))
|
&found))
|
||||||
goto err_exit;
|
return NULL;
|
||||||
|
|
||||||
if (bfd_get_flavour (abfd) == bfd_target_aout_flavour)
|
if (bfd_get_flavour (abfd) == bfd_target_aout_flavour)
|
||||||
{
|
{
|
||||||
if (! read_symbol_stabs_debugging_info (abfd, syms, symcount, dhandle,
|
if (! read_symbol_stabs_debugging_info (abfd, syms, symcount, dhandle,
|
||||||
&found))
|
&found))
|
||||||
goto err_exit;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try reading the COFF symbols if we didn't find any stabs in COFF
|
/* Try reading the COFF symbols if we didn't find any stabs in COFF
|
||||||
@@ -71,7 +74,7 @@ read_debugging_info (bfd *abfd, asymbol **syms, long symcount,
|
|||||||
&& symcount > 0)
|
&& symcount > 0)
|
||||||
{
|
{
|
||||||
if (! parse_coff (abfd, syms, symcount, dhandle))
|
if (! parse_coff (abfd, syms, symcount, dhandle))
|
||||||
goto err_exit;
|
return NULL;
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +83,6 @@ read_debugging_info (bfd *abfd, asymbol **syms, long symcount,
|
|||||||
if (! no_messages)
|
if (! no_messages)
|
||||||
non_fatal (_("%s: no recognized debugging information"),
|
non_fatal (_("%s: no recognized debugging information"),
|
||||||
bfd_get_filename (abfd));
|
bfd_get_filename (abfd));
|
||||||
err_exit:
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user