This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C source interspersed through assembly output
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Marty Hauff <marty dot hauff at rmit dot edu dot au>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 11 Nov 2003 23:23:41 -0800
- Subject: Re: C source interspersed through assembly output
- References: <sfb24578.003@its-mn-inet1.its.rmit.edu.au>
Marty Hauff wrote:
I'm a bit surprised that I can't find any command option in the doco to intersperse the originating source code as a comment in the assembly dump. I'm trying to check the validity of my assembly output and its kinda hard to track stuff back to the original C without this feature.
If you are using GNU as, then see the GNU as docs for the -a option
which produces listings file. Try for instance
gcc -O -g -Wa,-ahls file.c
Stepping through code in gdb may be helpful also, particularly if you
use a GUI like emacs M-x gdb or Insight (aka gdbtk). That way you can
see both the C and asm code while stepping through the program.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com