Hey all,
Can libunwind be configured to include "fake" frames from debug information in
the face of inlined functions? Meaning for code like this:
~~~~
#define forceinline inline __attribute__((always_inline))
forceinline void asdf()
{
new int[123];
}
forceinline void bar()
{
asdf();
}
forceinline void foo()
{
bar();
}
int main()
{
foo();
return 0;
}
~~~~
If I now use my heaptrack tool to grab a backtrace with libunwind on the
memory allocation, I'll see the following for an optimized build:
g++ -O3 -flto -ggdb3 inlining.cpp
main
at /home/milian/projects/src/heaptrack/tests/manual/inlining.cpp:20
in /ssd/milian/projects/build/heaptrack/a.out
GDB is capable of giving me a much more useful backtrace:
~~~~
Breakpoint 3, 0x00007ffff720f180 in malloc () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007ffff720f180 in malloc () from /usr/lib/libc.so.6
#1 0x00007ffff7ae1968 in operator new (sz=492) at /build/gcc-multilib/src/
gcc/libstdc++-v3/libsupc++/new_op.cc:50
#2 0x000000000040050e in asdf () at /home/milian/projects/src/heaptrack/
tests/manual/inlining.cpp:5
#3 bar () at /home/milian/projects/src/heaptrack/tests/manual/inlining.cpp:10
#4 foo () at /home/milian/projects/src/heaptrack/tests/manual/inlining.cpp:15
#5 main () at /home/milian/projects/src/heaptrack/tests/manual/inlining.cpp:
20
~~~~
Can I configure libunwind to give me an equivalent backtrace? If not, does
someone know if the unwinding method of GDB is accessible to third-parties as
a library?
Thanks
--
Milian Wolff
[email protected]
http://milianw.de
_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel