Mail Archives: djgpp/2001/08/05/05:51:52
Eli Zaretskii wrote:
>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.
BTW. , is 2.03 the most recent version for DOS ?
>> 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.)
I see.
I also found, that I have to type *.exe -h for help ,
and not /? as I'm used to.
I have a large file with all files in all GCC subdirectories now,
which I can search for keywords :-)
However, for that "assembly and C-code together" problem
I'm disappointed. With the -g switch I do get the C-code ,
although not the included .h files ,
but sometimes I have many C-lines (upto 500) followed by many
assembly lines (upto thousands).
It's still very difficult to figure out how a special C-line
is translated into assembly.
It worked (rather) well for my small test programs , but not for large
programs.
Guenter
- Raw text -