delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/22/06:58:17

Date: Sun, 22 Jul 2001 13:56:27 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Sterten AT aol DOT com
cc: djgpp AT delorie DOT com
Subject: Re: assembly translation of a single C-command
In-Reply-To: <dd.17ab78f7.288b3222@aol.com>
Message-ID: <Pine.SUN.3.91.1010722135558.6415D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 21 Jul 2001 Sterten AT aol DOT com 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'.
> 
> not with GCC 2.03 on my computer.
> The C-code is not in it.

Sorry, the FAQ fails to tell that you need to use -g as well:

  gcc -c -g -Wa,-a,-ad [other GCC options] foo.c > foo.lst

Without -g, the assembler won't have enough info to output the source
lines.

I will fix that in the next release of the FAQ.

(In general, whenever you have problems like that, it is advisable to
look up the relevant switches in the docs.  In this case, the node in
the Gas manual ("info as") which describes the -a switch tells you
that -g is required.)

- Raw text -


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