[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: binutils: objdump --disassemble -g: "no recognized debugging informa
From: |
Ian Lance Taylor |
Subject: |
Re: binutils: objdump --disassemble -g: "no recognized debugging information" |
Date: |
20 Nov 2003 11:40:16 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Andrew Pimlott <address@hidden> writes:
> I reported the following as a Debian bug[1] but received no reply,
> so I'll forward it to you. I am using Debian binutils package
> version 2.14.90.0.6-5 on Debian "testing".
>
> objdump --disassemble -g normally gives a nice assembly listing
> annotated with the original source code. However, when I tried this
> recently, I got the error "no recognized debugging information" and no
> source code. This can be demonstrated with a trivial program:
>
> % echo "int main(int argc, char **argv) { return 0; }" > try.c
> % gcc-3.3 -g -c try.c
> % objdump --disassemble -g try.o > /dev/null
> objdump: try.o: no recognized debugging information
>
> My gcc-3.3 is 1:3.3.2-0pre5, and 3.2 gives the same result. I tried
> other debugging flags to gcc, like -ggdb and -g3, with no difference.
> However, if I use gcc-2.95, objdump works as expected. Since it varies
> by gcc version, I suppose it may be gcc's fault, but since gcc's the de
> facto standard, I imagine objdump ought to accomodate if possible.
gcc recently changed the default from STABS debugging information to
DWARF debugging information. objdump -g doesn't support DWARF
debugging information.
The correct fix is for somebody to write and contribute DWARF
debugging support for objdump -g.
The interim fix is for you to use -gstabs instead of -g when invoking
gcc. Note, though, that DWARF is a better debugging format for some
purposes.
Ian