反汇编Linux程序
xxxxx是linux下编译生成的可执行程序
objdump -j .text -Sl xxxxx > obj.txt
记录堆栈信息函数
void SignalHandler(void)
{
void* array[10] = {0};
int size = 0;
char **strframe = NULL;
int i = 0, j = 0;
size = backtrace(array, 10);
strframe = (char **)backtrace_symbols(array, size);
printf("print call frame now:\n");
for(i = 0; i < size; i++)
{
printf("frame %d -- %s\n", i, strframe[i]);
}
if(strframe)
{
free(strframe);
strframe = NULL;
}
}
注册信号回调函数
signal(SIGSEGV, SignalHandler);
相关推荐
farwang 2020-11-25
星愿心愿 2020-11-24
tianhuak 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20
liuhangtiant 2020-10-20