C语言 什么是 .axf 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17761328/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 06:57:31  来源:igfitidea点击:

What are .axf files?

cembeddedarm

提问by Pravi

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.

我是 arm 架构的新手,我从事嵌入式软件工作,并试图了解我的项目二进制文件的调试文件夹中存在的 .axf 文件。

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?

发现它是链接器在构建过程中生成的arm可执行格式文件,用于调试崩溃。所以很明显它包含一些调试信息,但不清楚它是什么类型的信息?并且 debug 文件夹中还存在一个 .map 文件,那么这两个文件之间有什么区别呢?

回答by Clifford

The AXF file is an object file formatgenerated 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.

AXF 文件是由 ARM 的 RealView 编译器(也是 Keil 的 ARM-MDK 的一部分)生成的目标文件格式,包含目标代码和调试信息。在调试器中,虽然目标代码只加载到目标本身,但代码和调试信息都加载到开发主机的内存中。

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.

当通过 JTAG、SWD 或其他连接调试(任何类型的 - 不仅仅是崩溃)时,代码需要在主机上可用,以及将代码与原始源代码关联的调试信息。通过调试连接,仅传输最少的数据(例如寄存器值),因此,例如,调试器将获取程序计数器值,并能够使用 AXF 中的调试数据显示主机上可用的汇编程序和源代码。

The MAP file contains someof 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 codeassociation data needed by source level debugger.

MAP 文件包含一些相同的信息,但它旨在供人类阅读和使用而不是机器使用,并且不包含源代码级调试器所需的源代码行到目标代码关联数据。

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.

大多数情况下您可以忽略它 - 编译器生成它,调试器加载它。您的工具链可能还会生成一个 .hex 文件,该文件是您用于生产编程的文件,仅包含机器代码、常量数据和初始化程序。