Arm 中 ulibc 的回溯
我想知道是否有任何移植可用于 arm 中 uclibc 的反向跟踪实现,我可以在信号处理程序中使用它来调试分段错误。
我确实在这里遇到了一个有用的代码,并尝试在我的内部使用它信号处理程序,但它在第一次检查时失败并从那里返回。
我还尝试了一个递归回溯函数,它简单地使用 (current_frame_p)-3) 递归,直到它为 NULL 并打印 (current_frame_p)-1)。这似乎也给我带来了问题。我得到的只是处理程序的地址和一些垃圾大地址(我假设它可能是信号地址)。但我不会超出这个范围。我希望我的足迹能够超越这个范围。
崩溃的代码是专门为调试而编写的,以取消引用和无效地址。
任何帮助将不胜感激。
提前非常感谢。
-克沙夫
I wanted to know if any porting is available for back trace implementation for uclibc in arm that I can use in my signal handler to debug segmentation faults.
I did come across a useful code here and tried using it inside my signal handler but it fails at the first check and returns from there.
I also tried a recurcive backtrace function which simply recursed using (current_frame_p)-3) till it was NULL and printed (current_frame_p)-1). This too seems to give me issues. All I get is the address of the handler and some garbage big address (I assume it might be the signal address). But I don't go beyond that. I want my trace to go beyond that.
The code that crashes is purposefully written for debug to dereference and invalid address.
Any help will be much appreciated.
Many many thanks in advance.
-Keshav
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们在 Arm 设备上使用以下代码(但是 glibc)。
我几年前找到了这段代码(不记得具体在哪里)。
它工作得很好,没有任何问题。
和
We are using the following code on an Arm device (glibc however).
I have found this code couple of years ago (van't remember where exactly).
It's working just fine without any problems.
and
我知道问题是关于 uclibc 的,但我现在已经找到了如何使用 glibc 进行回溯,所以我想我会说。使用“gcc -funwind-tables -rdynamic”。 unwind-tables 选项使 libc:backtrace() 工作,而动态选项使 libc:backtrace_symbols() 工作。
I know the question was about uclibc, but I've found out how to get backtrace working with glibc now so I thought I'd say. Use "gcc -funwind-tables -rdynamic". The unwind-tables option makes libc:backtrace() work and the dynamic option makes libc:backtrace_symbols() work.