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

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

问题描述

在基于 ARM 的项目上开发时,我们会随机获得数据中止,也就是说,当我们玩它时,我们会得到一个数据中止中断.但是当我们用 r14 或 r13 检查寄存器映射时,即使检查函数回调,数据中止并不总是在同一点上.无论如何,我是否可以准确获取有关数据中止根本原因的信息?我已经尝试过 ref2 但当我陷入困境时无法得到同样的点中断数据.

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.

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

推荐答案

检查上面 Keil 链接中描述的链接寄存器 (r14) 将显示触发数据中止的指令.从那里你必须弄清楚为什么它会触发数据中止以及它是如何发生的,这是困难的部分.

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. 您在初始化之前使用了指针
  2. 您在指针或包含的内存已被释放(随后在另一个函数分配它时被修改)之后使用了该指针
  3. 指针因堆栈溢出而损坏
  4. 指针被其他不相关的、行为不端的代码破坏,这些代码正在践踏内存
  5. 该指针作为局部变量在堆栈上分配,然后在分配函数退出后使用
  6. 指针的类型对齐不正确(例如,尝试将 0x4001 作为 uint32_t 访问)

如您所见,很多因素都可能是 ARM 数据中止的根本原因.找到根本原因是让 ARM 软件/固件开发如此有趣的一部分!祝你解开谜题.

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天全站免登陆