Hi David,
I'm trying out libunwind in the context of a ptrace'd process. After downloading, compiling, and installing the libunwind library from git, I tried to compile tests/test-ptrace.c using the following command:
cd tests
gcc -I../include -lunwind-ptrace -lunwind-generic -lunwind -o test-ptrace test-ptrace.c
The instructions here:
http://www.nongnu.org/libunwind/man/libunwind-ptrace(3).html, indicates that's all it's to it. However, I'm getting the following compile error:
/tmp/ccsrDTfR.o: In function `do_backtrace':
test-ptrace.c:(.text+0x4b): undefined reference to `_Ux86_64_init_remote'
test-ptrace.c:(.text+0xa3): undefined reference to `_Ux86_64_get_reg'
test-ptrace.c:(.text+0xcd): undefined reference to `_Ux86_64_get_reg'
test-ptrace.c:(.text+0x157): undefined reference to `_Ux86_64_get_proc_name'
test-ptrace.c:(.text+0x215): undefined reference to `_Ux86_64_get_proc_info'
test-ptrace.c:(.text+0x2ca): undefined reference to `_Ux86_64_step'
test-ptrace.c:(.text+0x2f4): undefined reference to `_Ux86_64_get_reg'
/tmp/ccsrDTfR.o: In function `main':
test-ptrace.c:(.text+0x480): undefined reference to `_UPT_accessors'
test-ptrace.c:(.text+0x485): undefined reference to `_Ux86_64_create_addr_space'
test-ptrace.c:(.text+0x62b): undefined reference to `_Ux86_64_set_caching_policy'
test-ptrace.c:(.text+0x7d5): undefined reference to `_UPT_create'
test-ptrace.c:(.text+0xbf0): undefined reference to `_UPT_destroy'
test-ptrace.c:(.text+0xbff): undefined reference to `_Ux86_64_destroy_addr_space'
I've replaced `-lunwind-generic` with `-lunwind-x86_64` since I'm on this arch, and I'm still getting the same error message. Any ideas? Thanks!