Pages: [1]   Go Down
Author Topic: Assemler results, where?  (Read 2269 times)
0 Members and 1 Guest are viewing this topic.
Norway@Oslo
Offline Offline
Edison Member
*
Karma: 12
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I can not find the results that the compiler outputs.
...starting to worry I might be blind  :o
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 64
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can use the avr-objdump utility with the -S option (I think) on a .hex file to disassemble your sketch. Using it on a .elf file will let you see your C++ inline with the assembly. Can't recall that option off the top of my head.
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The option to dump source intermixed with  with  disassembly is –S

A useful tip for conveniently generating dump files is to create a batch file that invokes avr-objdump.exe and sends the output to a text file in the sketch directory. Here is a batch file that will do this, you need to rename the path to match the location of avr-dump.exe on your machine

Code:
rem: this batch will send avr-objdump output of the elf file given as the parameter to a file in that directory with .txt appended
rem: change the path below so its correct for the location of objdump.exe on your machine
C:\Arduino\arduino-0011\hardware\tools\avr\bin\avr-objdump.exe -S %1 > %1%.txt
If you are using windows, save the batch to a file called avr-objdump.bat in the sendto directory. (tip: from the start menu,  click run and type sendto into the text box and click ok)

If the batch is in the sentdo directory then you can right click on an elf file in a sketch applet directory and the batch will create a dump file in that directory with the extension .txt

I hope you find that as useful as I have.
« Last Edit: April 12, 2008, 02:48:51 am by mem » Logged

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 12
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you mem!   smiley-grin
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried and it works, but generates an empty txt file.
any suggestion?
Logged

Maastricht Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It generates an empty file by me also.
Try this, it works:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1241117308/0#0
Logged

Pages: [1]   Go Up
Jump to: