Message-ID: <38BC06FB.32548B21@cyberoptics.com> From: Eric Rudd Organization: CyberOptics X-Mailer: Mozilla 4.08 [en] (Win95; U) MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Combined C/asm listing (was Re: Fastest bitblt?) References: <38BBDCDA DOT 7CA5C1CE AT cyberoptics DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 44 Date: Tue, 29 Feb 2000 11:50:51 -0600 NNTP-Posting-Host: 38.196.93.9 X-Trace: client 951846652 38.196.93.9 (Tue, 29 Feb 2000 12:50:52 EST) NNTP-Posting-Date: Tue, 29 Feb 2000 12:50:52 EST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eric Rudd wrote: > Kalum Somaratna aka Grendel wrote: > > > If you want to see the C code together with the assembly it was converted to, > > use a command line like this: > > > > gcc -c -Wa,-a,-ad [other GCC options] foo.c > foo.lst > > > > which will output the combined C/assembly listing to the file `foo.lst'. > > I read this posting with interest, because I have often wanted an assembly output > listing similar to what Borland produces with the -S option, with each C > statement interleaved with the assembler code it generates. Unfortunately, the > above options do not do this, as was claimed -- I only get assembler, binary, and > cross references; no C source. Is it possible to get interleaved C and assembly > output? > My apologies for the previous posting. I must have been typing something in > wrong, because the next time I tried it, it worked as advertised. There's not as much egg on my face as I thought. I repeatedly tried running gcc 2.95.2 with the above options, and saw it work twice. (I am using v2.8.1 of binutils.) The other times, I only got an assembly listing (no C source). However, I have been able to get it to work consistently with the following options: gcc -g -Wa,-adhl foo.c >foo.lst The -g option seems to be necessary, but I'm still puzzled by those two runs earlier this morning -- they came out in a different format. With the -g -Wa,-adhl technique, the C source comes out with **** to the left of each statement, but the two times that -Wa,-a,-ad worked, I got the C source in between assembly directives like this: /APP C statement /NO_APP Does anyone have an idea why I am getting inconsistent results here? Is there some file sitting in the current directory that is affecting the output? -Eric Rudd rudd AT cyberoptics DOT com