ARM Data Abort 错误异常调试 [英] ARM Data Abort error exception debugging

查看:42
本文介绍了ARM Data Abort 错误异常调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以现在我知道我收到了 ARM 数据中止异常 - 我看到了如何捕获异常本身(STL 库中的错误地址),但我想在异常之前返回堆栈帧.我正在使用 IAR 工具链,它告诉我异常后调用堆栈不可用 - 有没有一种技巧可以说服工具向我显示调用堆栈?感谢所有快速帮助!

So now I understand that I'm getting a ARM Data Abort exception - I see how to trap the exception itself (a bad address in the STL library), but I would like to walk back up the stack frame before the exception. I'm using the IAR toolchain, and it tells me the call stack is unavailable after the exception - is there a trick way to convince the tool to show me the call stack? Thanks for all the quick help!

推荐答案

如果您查看 ARM ARM(ARM 架构参考手册,只需 googlearm arm"),程序员模型 -> 处理器模式和寄存器部分.在中止模式下,您具有特权,因此您可以从中止切换到主管,然后制作 r13 的副本,然后切换回中止模式并从 r13 的副本中转储堆栈.您的 r14 还会告诉您中止发生的位置.

if you look at the ARM ARM (ARM Architecture Reference Manual, just google "arm arm"), Programmers Model -> Processor modes and Registers sections. When in abort mode you are priveledged so you can switch from abort to say supervisor and then make a copy of r13, then switch back to abort mode and dump the stack from the copy of r13. Your r14 also tells you where the abort occurred.

如果这次中止是由于对齐,我不会感到惊讶.试图读/写一个字,其地址的低两位不是零,或者是地址集的 lsbit 的半字.实际上,如果您使用链接寄存器和寄存器转储 (r0-r12),因为 abort 和 user/supervisor 使用相同的寄存器空间,您可以查看导致 abort 的指令和地址,看看它是否确实是一个对齐问题或其他问题.请注意,PC 会提前一、二或三条指令,具体取决于中止的模式拇指或手臂,如果您根本不使用拇指,则无需担心.

I wouldnt be surprised if this abort was from an alignment. Trying to read/write a word with an address with something other than zeros in the lower two bits or a halfword with the lsbit of the address set. Actually if you take the link register and a dump of the registers (r0-r12) since abort and user/supervisor use the same register space, you can look at the instruction that caused the abort and the address to see if it was indeed an alignment problem or something else. Note that the pc is one, two or three instructions ahead depending on the mode thumb or arm that had the abort, if you are not using thumb at all then this nothing to worry about.

这篇关于ARM Data Abort 错误异常调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆