Mail Archives: djgpp/2001/07/22/06:58:17
On Sat, 21 Jul 2001 Sterten AT aol DOT com wrote:
> >If you want to see the C code together with the assembly it was converted to,
> >use a command line like this:
> >
> > gcc -c -Wa,-a,-ad [other GCC options] foo.c > foo.lst
> >
> >which will output the combined C/assembly listing to the file `foo.lst'.
>
> not with GCC 2.03 on my computer.
> The C-code is not in it.
Sorry, the FAQ fails to tell that you need to use -g as well:
gcc -c -g -Wa,-a,-ad [other GCC options] foo.c > foo.lst
Without -g, the assembler won't have enough info to output the source
lines.
I will fix that in the next release of the FAQ.
(In general, whenever you have problems like that, it is advisable to
look up the relevant switches in the docs. In this case, the node in
the Gas manual ("info as") which describes the -a switch tells you
that -g is required.)
- Raw text -