What are .axf files?

2019-03-25 04:02发布

I am new to arm architecture, I work on embedded software and was trying to learn about the .axf file which is present in my project binary's debug folder.

Discovered that it is an arm executable format file generated by linker while the build process and it is used in debugging the crashes. So it is obvious that it contains some debugging information but its not clear what kind of information that is? And also there exists one .map file in the debug folder, so what could be the difference between these two files?

标签: c embedded arm
1条回答
Explosion°爆炸
2楼-- · 2019-03-25 04:31

The AXF file is an object file format generated by ARM's RealView compiler (also part of Keil's ARM-MDK) and contains both object code and debug information. In the debugger, while just the object code is loaded on the target itself, both the code and the debug information are loaded in the development host's memory.

When debugging (of any kind - not just crashes) via JTAG, SWD or other connection the code needs to be available on the host along with the debug information that associates that code with the original source code. Over the debug connection, only minimal data such as register values are transferred, so for example the debugger will take the program counter value and be able to display the assembler and source code which is available on the host using the debug data in the AXF.

The MAP file contains some of the same information, but it is intended for human readability and consumption rather than machine use, and does not contain the source code line to object code association data needed by source level debugger.

Mostly you can ignore it - the compiler generates it, the debugger loads it. Your toolchain probably also generates a .hex file which is what you'd use for production programming and contains just the machine code and constant data and initialisers.

查看更多
登录 后发表回答