This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C source interspersed through assembly output


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]