|
|
|
|
|
by feffe
1485 days ago
|
|
In my experience debuggers handles this fine. Some archs also has a link register (jump and link) which may help finding back. This test is from x86-64 Linux. /*
gcc -g -Wall -o x x.c
gdb ./x
(gdb) r
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x0000555555554617 in foo () at x.c:6
#2 0x0000555555554628 in main () at x.c:10
(gdb) f 1
#1 0x0000555555554617 in foo () at x.c:6
6 bar();
(gdb) p bar
$1 = (void (*)(void)) 0x0
*/
#include <stddef.h>
void (*bar)(void) = NULL;
void foo() {
bar();
}
int main() {
foo();
}
|
|