Date: Mon, 18 Aug 1997 12:57:33 +1100 From: Bill Currie Subject: Re: assembler o/p with cpp source In-reply-to: <33F2379E.4DE8@cornell.edu> To: asu1 AT cornell DOT edu, djgpp AT delorie DOT com Message-id: <199708180102.NAA00990@teleng1.tait.co.nz gatekeeper.tait.co.nz> Organization: Tait Electronics Limited MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Comments: Authenticated sender is Precedence: bulk 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.