Assembler List File for Teensy 3.1

Status
Not open for further replies.

TelephoneBill

Well-known member
Teensy 3.1 - is it possible to adjust the Arduino/Teensyduino IDE to automatically produce an assembly "List File" in the temp Build folder when the Verify button has been pressed? I'm thinking there may be a script somewhere where you could edit it to get one.
 
Edit the file that provides the options to the compiler and add the option: -save-temps=obj. It will deposit .ii and .s files in the object directory (where it puts the .o files). The .ii files are after preprocessing is done, and .s files are assembler input files. I don't recall off hand where the option file lives (and it might be in a different location on different OSes). :cool:
 
Last edited:
Thanks. (The beauty of this form is that you learn something ever time - .ii files).

I have now come across a tool in the ARM toolchain called "objdump.exe" and this will process the .elf file in the BUILD folder using the -D switch to mix an assembly listing in with the original source statements. On reflection, it may be better to run this manually when desired and avoid the overhead in the compile/link/locate every time. But thanks for your idea.
 
I added the original -save-temps option back in 1988 when I was working on the Motorola 88000 port for Data General, and about 4 years ago, I added -save-temps=obj due to issues with complex builds on machines with many cores where you build things in parallel. Its main use is to be added as a normal option, but save the intermediate files to be used later, just in case you need it.

You can also run objdump on the .o files (object files) that are in the build directory, if you want to see what the code generated is for a particular module. If you add the option to add debug information (-g) to the compilation, the objdump -l option will indicate the source file and line number from the code that is generated. At the present time, there is no debugger for Teensy, but it is harmless to add -g if you are going to use objdump.
 
Status
Not open for further replies.
Back
Top