英文:
addr2line - fails on basic example
问题
It appears you're looking for a code review or assistance with an issue, but your request doesn't specify what exactly you need help with. Could you please provide more context or clarify your question?
英文:
#include <stdio.h>
void __cyg_profile_func_enter(void *func, void *caller) __attribute__((no_instrument_function));
void __cyg_profile_func_exit(void *this_fn, void *call_site) __attribute__((no_instrument_function));
void __cyg_profile_func_enter(void *func, void *caller)
{
printf("%p\n", func);
printf("%p\n", caller);
}
void __cyg_profile_func_exit(void *this_fn, void *call_site)
{
}
void my_function(int a, int b)
{
a = a * b;
}
void dummy_function()
{
int a = 10;
int b = 20;
my_function(a, b);
}
int main()
{
int x = 42;
int y = 73;
dummy_function();
my_function(x, y);
return 0;
}
Build commands:
gcc -x c boost_stacktrace.cpp -finstrument-functions -rdynamic -g -O0 -o boost_stacktrace.exe
./boost_stacktrace.exe | tee addrs.txt
0x55d97d38324c
0x7f0fa12b0d90
0x55d97d3831f4
0x55d97d383287
0x55d97d3831a9
0x55d97d383233
0x55d97d3831a9
0x55d97d383296
addr2line -e boost_stacktrace.exe -f -i -p < addrs.txt
?? ??:0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
QUESTION
What am I doing wrong?
答案1
得分: 2
After I added -no-pie
to my compile command, it worked.
英文:
After I added -no-pie
to my compile command, it worked.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论