Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » AVR-GCC
  • » [avr-gcc-list] How does one get gcc *.lst file with interspersed Source Listing and Assembler? [RSS Feed]

#1 Dec. 2, 2005 06:07:47

Patrick S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] How does one get gcc *.lst file with interspersed Source Listing and Assembler?


 Hello, I am using gcc, and am trying to find out how to get a list
output of I Tried “gcc -Wa,-alh hello.c”, but it didn’t
work.  I get output that looks like the following (it doesn’t have
the *.c lines interspersed to where it corresponds to chunks of Assember
code).  Does anyone know a way to get the *.c source lines interspersed
within the below output (i.e. what gcc or as options etc…?)?  … 493                   
L142: 494 057c
8B1D0000             
movl    _OutFilePtr, %ebx 494      0000 495 0582
0FBEC1               
movsbl  %cl,%eax 496 0585
890424               
movl    %eax, (%esp) 497 0588
895C2404             
movl    %ebx, 4(%esp) 498 058c
E8000000             
call    _fputc 498      00 499 0591
0FB60D00             
movzbl  _C1, %ecx 499      000000 500 0598
80F90A               
cmpb    $10, %cl 501 059b
0F95C0               
setne   %al 502 059e
31D2                 
xorl    %edx, %edx 503 05a0
80F90D               
cmpb    $13, %cl 504 05a3
0F95C2               
setne   %dl 505 05a6
85D0                 
testl   %eax, %edx 506 05a8 0F842CFE             
je      L85 506      FFFF 507                   
L143: 508 05ae
A1000000             
movl    _OutFilePtr, %eax 508     
00…  Thanks, Pat//_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#2 Dec. 2, 2005 06:12:31

Ian C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] How does one get gcc *.lst file with interspersed Source Listing and Assembler?


Hi Patrick,

You can generate the list files you want with

gcc -Wa,-ahlms=hello.lst hello.c

I hope this helps,

Ian Caddy



Patrick Sullivan wrote:Hello,I am using gcc, and am trying to find out how to get a list output ofI Tried “gcc -Wa,-alh hello.c”, but it didn’t work. I get output thatlooks like the following (it doesn’t have the *.c lines interspersed towhere it corresponds to chunks of Assember code). Does anyone know away to get the *.c source lines interspersed within the below output(i.e. what gcc or as options etc…?)?…

493 L142:

494 057c 8B1D0000 movl _OutFilePtr, %ebx

494 0000

495 0582 0FBEC1 movsbl %cl,%eax

496 0585 890424 movl %eax, (%esp)

497 0588 895C2404 movl %ebx, 4(%esp)

498 058c E8000000 call _fputc

498 00

499 0591 0FB60D00 movzbl _C1, %ecx

499 000000

500 0598 80F90A cmpb $10, %cl

501 059b 0F95C0 setne %al

502 059e 31D2 xorl %edx, %edx

503 05a0 80F90D cmpb $13, %cl

504 05a3 0F95C2 setne %dl

505 05a6 85D0 testl %eax, %edx

506 05a8 0F842CFE je L85

506 FFFF

507 L143:

508 05ae A1000000 movl _OutFilePtr, %eax

508 00

…Thanks,Pat//


------------------------------------------------------------------------

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-l***@*ongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list--
Ian Caddy
Goanna Technologies Pty Ltd
+61 8 9221 1860



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#3 Dec. 2, 2005 06:14:09

Joerg W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] How does one get gcc *.lst file with interspersed Source Listing and Assembler?


"Patrick Sullivan" <> wrote:

> Does anyone know a way to get the *.c source lines interspersed
> within the below output (i.e. what gcc or as options etc...?)?

What you're looking for is usually implemented as a disassembler
listing: avr-objcopy -S does that job. It re-injects the source code
based on the debugging (i.e. line number) information. Of course,
that has its drawbacks, as there's not necessarily a 1:1 mapping.

--
cheers, J"org .-.-. --... ...-- -.. . DL8DTLhttp://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#4 Dec. 2, 2005 06:24:32

Ian C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] How does one get gcc *.lst file with interspersed Source Listing and Assembler?


Hi Patrick,I would say that it is the -g as we don't use the -L or -c switches andwe get the listings with the high level source interspersed.regards,

Ian Caddy


Patrick Sullivan wrote:Thanks Ian. I found out that we need maybe the -L -g or -c switch as
well (since when I ran your recommended command I didn't see the *.c
file lines interspersed. I successfully ran with 'gcc -Wa,-ahls,-L -g
-c hello.c > hello.lst'

Thanks for responding.


Pat//

-----Original Message-----From: Ian Caddy Sent: Thursday, December 01, 2005 10:12 PMTo: Patrick Sullivan
Cc: avr-gcc-l***@*ongnu.org
Subject: Re: How does one get gcc *.lst file with
interspersed Source Listing and Assembler?

Hi Patrick,

You can generate the list files you want with

gcc -Wa,-ahlms=hello.lst hello.c

I hope this helps,

Ian Caddy



Patrick Sullivan wrote:Hello,



I am using gcc, and am trying to find out how to get a list output of



I Tried "gcc -Wa,-alh hello.c", but it didn't work. I get output thatlooks like the following (it doesn't have the *.c lines interspersedtowhere it corresponds to chunks of Assember code). Does anyone know away to get the *.c source lines interspersed within the below output(i.e. what gcc or as options etc...?)?...

493 L142:

494 057c 8B1D0000 movl _OutFilePtr, %ebx

494 0000

495 0582 0FBEC1 movsbl %cl,%eax

496 0585 890424 movl %eax, (%esp)

497 0588 895C2404 movl %ebx, 4(%esp)

498 058c E8000000 call _fputc

498 00

499 0591 0FB60D00 movzbl _C1, %ecx

499 000000

500 0598 80F90A cmpb $10, %cl

501 059b 0F95C0 setne %al

502 059e 31D2 xorl %edx, %edx

503 05a0 80F90D cmpb $13, %cl

504 05a3 0F95C2 setne %dl

505 05a6 85D0 testl %eax, %edx

506 05a8 0F842CFE je L85

506 FFFF

507 L143:

508 05ae A1000000 movl _OutFilePtr, %eax

508 00

...





Thanks,



Pat//------------------------------------------------------------------------_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-l***@*ongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list--
Ian Caddy
Goanna Technologies Pty Ltd
+61 8 9221 1860



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#5 Dec. 2, 2005 07:17:58

Dave H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] How does one get gcc *.lst file with interspersed Source Listing and Assembler?


Resending to the list.

Hi Patrick,

> I Tried "gcc -Wa,-alh hello.c", but it didn't work. I get output that looks
> like the following (it doesn't have the *.c lines interspersed to where it
> corresponds to chunks of Assember code). Does anyone know a way to get the
> *.c source lines interspersed within the below output (i.e. what gcc or as
> options etc…?)?

This should work for you:

avr-gcc -c -gstabs -Wa,-ahlmsd=file.lst file.c

The assembler is what produces the combined listing and it requires
the stabs information in order to get the line number information.

avr-objdump --source file.o

will also produce an intermixed listing, but I personally find this
inferior to the one produced by letting the assembler do the listing.

--
Dave Hylands
Vancouver, BC, Canadahttp://www.DaveHylands.com/_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

  • Root
  • » AVR-GCC
  • » [avr-gcc-list] How does one get gcc *.lst file with interspersed Source Listing and Assembler? [RSS Feed]

Board footer

Moderator control

Enjoy the 23rd of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support