dwarf-assembly/tests/stack_walked.cpp

16 lines
285 B
C++
Raw Normal View History

2018-04-26 19:17:34 +02:00
#include <cstdio>
#include <dlfcn.h>
#include "../stack_walker/stack_walker.hpp"
int main() {
Dl_info main_info;
int rc = dladdr((void*)&main, &main_info);
printf("I'm in %s!\n", (rc != 0) ? main_info.dli_sname : "[No data]");
stack_walker_init();
return 0;
}