This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:Code Composer Studio
我有如下代码:
void syscpudebughandler (void)
{
ArmDebugHandler (((PFAPPDEBUGHANDLER) CAL_AppDebugHandler);
返回;
}
但是、我在发布时会得到不同的机器代码:
syscpudebughandler():
8007edfc: E30A0AF4 movw r0、#0xaaf4
8007e00: E3480002 movt r0、#0x8002
8007e04: EAFFFEC b ArmDebugHandler
和在调试中:
294 {
syscpudebughandler():
8009c3e4: E92D4800 推 送{r11、lr}
8009c3e8: E28DB004 添加 了 r11、sp、#4
295 ArmDebugHandler (((PFAPPDEBUGHANDLER) CAL_AppDebugHandler);
8009c3ec: E30100D4 movw r0、#0x10d4
8009c3f0: E3480003 movt r0、#0x8003
8009c3f4: EB000001 BL ArmDebugHandler
296 返回;
8009c3f8: E320F000 nop
297 }
8009c3fc: E8BD8800 pop {r11、PC}
为什么在发布模式下编译函数调用之前没有栈指令、在函数调用之后没有栈指令?
版本配置可能在较高层面上启用了编译器优化、而调试配置可能不启用。
谢谢、此致、
乔治