Mark U kirjoitti:
Hi,
I'm just curious to know whether there is any option in GNU GCC to get
the C code and the corresponding asembly.
The problem with this issue is that it is explained in the GNU
assembler manual,
not in the GCC manual :-( The expectation however seems to be that it
is explained
in the GCC manual ! Anyhow the 'as' manual tells in the Chapter 2 :
"If you are invoking as via the gnu C compiler, you can use the `-Wa'
option to pass
arguments through to the assembler. The assembler arguments must be
separated
from each other (and the `-Wa') by commas. For example:
gcc -c -g -O -Wa,-alh,-L file.c
This passes two options to the assembler: `-alh' (emit a listing to
standard output with
high-level and assembly source) and `-L' (retain local symbols in the
symbol table)."
The debug option '-g' causes the row number and source info being added
into the
output for 'as'. The listing comes to the standard output so a
redirection into a file can
be a better solution....