linux 打印堆栈日志_在ARM-Linux打印堆栈跟踪

I followed this post to print stack trace How to generate a stacktrace when my gcc C++ app crashes . It works well in x86 linux. Can anyone teach me how to make it work on arm-linux?

I am using arm-linux-gcc 4.4.3.

[root@FriendlyARM /]# ./test1

Error: signal 11:

[0x0]

in x86

mickey@mickeyvm:~/Desktop/workspace/test/testCatchSeg/src$ ./test1

Error: signal 11:

./test1(_Z7handleri+0x19)[0x804876d]

[0xedd400]

./test1(_Z3bazv+0x10)[0x80487c2]

./test1(_Z3barv+0xb)[0x80487e1]

./test1(_Z3foov+0xb)[0x80487ee]

./test1(main+0x22)[0x8048812]

/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x84de37]

./test1[0x80486c1]

This is how I compile for arm-linux

arm-linux-g++ -g -rdynamic ./testCatchSeg.cpp -o testCatchSeg

解决方案

ARM does not store the return address on the stack when branching to a subroutine but rather expects any function calling subroutines to save the link register to its own stack frame before calling other functions, so it is impossible to follow stack frames without debug information.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值