简体   繁体   English

gdb ARM Cortex-M异常解除

[英]gdb ARM Cortex-M exception Unwinding

I have been working with some Cortex-M4 (Freescale K60) devices with a compiled by me GCC (v4.7.2), BinUtils (v2.22), Newlib (v1.20) and GDB (v7.5). 我一直在使用一些由我编译的GCC(v4.7.2),BinUtils(v2.22),Newlib(v1.20)和GDB(v7.5)编译的Cortex-M4(Freescale K60)设备。 I have always been annoyed by GDB's inability to unwind from hard exceptions. 我一直为GDB无法摆脱硬异常而烦恼。

recently I had an opportunity to use FreeScale's CodeWarrior, where I loaded my binary for debug (compiled by my tools), and it could unwind the exception. 最近,我有机会使用FreeScale的CodeWarrior,在其中加载了二进制文件进行调试(由我的工具编译),它可以消除异常。 It looks like CodeWarrior is running GDB v7.4.1 under the hood. 看起来CodeWarrior在后台运行GDB v7.4.1。 Is there some patch I missed for GDB, or some configure option? 是否有我错过的GDB补丁或一些配置选项?

Here is the script used to build GDB: TOOLCHAIN=gdb-7.5 mkdir -p BUILD/gdb cd BUILD/gdb ../../${TOOLCHAIN}/configure --prefix=${PREFIX} --target=${TARGET} --enable-interwork --enable-multilib --with-expat=yes --with-python --without-auto-load-safe-path 2>&1 | 以下是用于构建GDB的脚本:TOOLCHAIN = gdb-7.5 mkdir -p BUILD / gdb cd BUILD / gdb ../../${TOOLCHAIN}/configure --prefix = $ {PREFIX} --target = $ { TARGET} --enable-interwork --enable-multilib --with-expat = yes --with-python --without-auto-load-safe-path 2>&1 | tee configure.out make all install cd ../../ tee configure.out使所有安装cd ../../

Thanks! 谢谢!

GDB can do Cortex M profile exception unwinding, once you tell it that the target is actually Cortex M profile using a Target Description XML with correct Feature . 使用具有正确Feature目标描述 XML 告诉目标对象实际上是Cortex M配置文件后,GDB便可以解决该问题。

This can be done via the set target tdesc <filename> command, but newer gdb servers (eg OpenOCD) should do so already. 可以通过set target tdesc <filename>命令来完成,但是较新的gdb服务器(例如OpenOCD)应该已经这样做了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM