www.delorie.com/djgpp/mail-archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/29/14:19:57

Message-ID: <38BC06FB.32548B21@cyberoptics.com>
From: Eric Rudd <rudd AT cyberoptics DOT com>
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: <Pine DOT LNX DOT 4 DOT 10 DOT 10002270616350 DOT 904-100000 AT darkstar DOT grendel DOT net> <38BBDCDA DOT 7CA5C1CE AT cyberoptics DOT com>
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019