问题
I'm trying to find all the places in the source of a running program where certain syscalls are used. I set breakpoints like:
catch syscall socketcall
...Which is working fine. However, when one of the breakpoints is actually hit, the backtrace always looks the same:
(gdb) bt
#0 __cp_end () at src/thread/i386/syscall_cp.s:25
And that's all she wrote! Why can't GCC walk the stack and show a full stacktrace going all the way up to main
?
回答1:
Why can't GCC walk the stack and show a full stacktrace going all the way up to main?
Most likely because hand-written assembly in syscall_cp.s
lacks unwind descriptors, and is not using frame pointers. GDB needs one or the other. See also this answer.
来源:https://stackoverflow.com/questions/29764951/why-does-gdb-backtrace-show-only-one-frame-when-catching-syscall