转自:http://blog.csdn.net/vpwork/article/details/7680102
%pF versatile_init+0x0/0x110
%pf versatile_init
版权声明:本文为博主原创文章,未经博主允许不得转载。
[cpp] view plain copy #include <stdio.h>
#include <stdlib.h>
#include <signal.h> #define MAX_LEVEL 4
void sigfunc(int signo)
{
printf("%s(0): %p\n", __func__, __builtin_return_address());
exit();
} int b()
{
printf("%s(0): %p\n", __func__, __builtin_return_address());
printf("%s(1): %p\n", __func__, __builtin_return_address());
while()
{
sleep();
}
} int a(int temp)
{
temp += ;
printf("%s(0): %p\n", __func__, __builtin_return_address()); b(); return temp;
} int main()
{
signal(SIGINT, sigfunc);
a(); return ;
} 执行后:
a(): 0x400675
b(): 0x400653
b(): 0x400675
^Csigfunc(): 0x30bda33140 用gdb调试:
gdb e
...
(gdb) l *0x400675
0x400675 is in main (e.c:).
int main()
{
signal(SIGINT, sigfunc);
a(); return ;
}