Created
August 31, 2017 13:56
-
-
Save Duhemm/6728e4171f365c1453c89d0ccecddbc2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <libunwind.h> | |
#include <stdio.h> | |
int fn5() { | |
unw_context_t context; | |
unw_cursor_t cursor; | |
unw_proc_info_t info; | |
unw_getcontext(&context); | |
unw_init_local(&cursor, &context); | |
int i = 0; | |
while (unw_step(&cursor) > 0) { | |
unw_get_proc_info(&cursor, &info); | |
printf("start: %llu\n", info.start_ip); | |
i += 1; | |
} | |
return i; | |
} | |
int fn4() { | |
return fn5(); | |
} | |
int fn3() { | |
return fn4(); | |
} | |
int fn2() { | |
return fn3(); | |
} | |
int fn1() { | |
return fn2(); | |
} | |
int main() { | |
return fn1(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment