Why does gdb backtrace show only one frame when catching syscall?

做~自己de王妃 提交于 2019-12-11 02:31:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!