Mail Archives: djgpp/1997/08/17/20:59:25
On 13 Aug 97 at 18:39, A. Sinan Unur wrote:
> i96csm AT river DOT tay DOT ac DOT uk wrote:
> >
> > Is there anyway to get gpp
> > to produce assembly output WITH the C++ source code commented out
> > (So it looks something like this)
>
> AFAIK no. however, did you look at the assembly output gcc produces.
> if not, try compiling your source as gcc -S -c foo.c and look at the
> file foo.s.
Actally, there is. It uses the assembler to generate a listing file:
gcc -c -g -O2 -Wa,-alh foo.c>foo.lst
or
gcc -c -g -O2 -Wa,-alh foo.cc>foo.lst
The -O2 isn't needed, it's just to show that this still works with
optimisation. One word of warnig: C++ puts line number info for
generated functions as well as your functions, causing some strange
results, but your functions will have the correct lines associated
with them (there just may be more one line 50 from the debug info's
point of view).
Bill
--
Leave others their otherness.
- Raw text -