如何在arm平台上调试随机数据中止问题 [英] How to debug random data abort issue on arm based platform

查看:185
本文介绍了如何在arm平台上调试随机数据中止问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发基于ARM的项目时,我们可以随意地中止数据,这就是当我们玩它时,我们得到一个数据中止中断。但是,当使用r14或r13检查寄存器映射时,即使检查函数回调,数据中止并不总是在同一点。有没有正确的数据中止的根源的信息呢?我尝试参考 2 ,但是当我陷阱时不能得到相同的点关于中断的数据。



相关
ARM数据中止错误异常调试
ARM :如何分析数据异常

解决方案

按照您的Keil链接中所述检查链接寄存器(r14)以上将显示触发数据中止的指令。从那里你必须弄清楚为什么它触发了一个数据中止,怎么会发生,这是困难的部分。



在我的经验中,最有可能发生的是你访问了一个无效的指针。由于很多原因可能无效。以下是几个候选人:


  1. 您在初始化之前使用指针

  2. 您使用指针后面的指针或包含的内存已被释放(并且随后在另一个功能分配时被修改)

  3. 指针被堆栈溢出损坏

  4. 指针被内存上的其他不相关的行为不正当的代码所破坏

  5. 指针在堆栈上作为局部变量分配,然后在分配函数退出后使用

  6. 指针的类型不正确(例如,尝试以0xint001的形式访问0x4001)

如您所见,很多事情可能是ARM数据中止的根本原因。寻找根本原因是使ARM软件/固件开发变得非常有趣的一部分!祝你好运,找出你的难题。


As developing on ARM based project, we get data abort randomly, that is when we play with it we get a data abort interrupt. But the data abort is not always on the same point when we check with the register map with r14 or r13, even though check the function callback. Is there anyway that I can get the information about the root cause on data abort precisely? I have try the ref2 but could not get the same point when I trap the data about interrupt.

Related ARM Data Abort error exception debugging ARM: HOW TO ANALYZE A DATA ABORT EXCEPTION

解决方案

Checking the link register (r14) as described in your Keil link above will show you the instruction that triggered the data abort. From there you'll have to figure out why it triggered a data abort and how that could have happened, which is the difficult part.

In my experience what most likely happened is that you accessed an invalid pointer. It can be invalid for many reasons. Here are a few candidates:

  1. You used the pointer before it was initialized
  2. You used the pointer after it, or the containing memory, had been freed (and was subsequently modified when another function allocated it)
  3. The pointer was corrupted by a stack overflow
  4. The pointer was corrupted by other, unrelated, misbehaving code that is trampling on memory
  5. The pointer was allocated on the stack as a local variable and then used after the allocating function had exited
  6. The pointer has incorrect alignment for its type (for example, trying to access 0x4001 as a uint32_t)

As you can see, lots of things can be the root cause of an ARM data abort. Finding the root cause is part of what makes ARM software/firmware development so much fun! Good luck figuring out your puzzle.

这篇关于如何在arm平台上调试随机数据中止问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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