This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C and assembly listing
- To: tprince at computer dot org (Tim Prince)
- Subject: Re: C and assembly listing
- From: tm at kloo dot net (tm)
- Date: Mon, 5 Nov 2001 16:13:13 -0800 (PST)
- Cc: pcarlini at unitus dot it (Paolo Carlini),sanjivg at noida dot hcltech dot com (Sanjiv Kumar Gupta), gcc at gcc dot gnu dot org
>
>
> ----- Original Message -----
> From: "Paolo Carlini" <pcarlini@unitus.it>
> To: "Sanjiv Kumar Gupta" <sanjivg@noida.hcltech.com>; <gcc@gcc.gnu.org>
> Sent: Monday, November 05, 2001 4:17 AM
> Subject: Re: C and assembly listing
>
>
> > Sanjiv Kumar Gupta wrote:
> >
> > > Microsoft compiler has a /FA option to produce C and assembly
> mixture. Does
> > > gcc provide a similar one???
> >
> > Usually, I invoke objdump with the -S switch on the object file (*.o)
> to obtain
> > that mixture (with -g for gcc).
> > Dunno if something like this can also be produced by gcc itself.
> >
> > Cheers,
> > Paolo Carlini.
> >
> This has been the best option for the x86 version, although it has been
> known to skip a few instructions.
>
>
The best option IMHO is to compile with -g to an object file, then do:
objdump --source --disassemble foo.o
Toshi