Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb_bthread_stack.py not work. #2674

Open
zhaoyulong opened this issue Jul 2, 2024 · 7 comments
Open

gdb_bthread_stack.py not work. #2674

zhaoyulong opened this issue Jul 2, 2024 · 7 comments

Comments

@zhaoyulong
Copy link

Describe the bug (描述bug)
使用gdb查看bthread报错

(gdb) source /home/user/brpc/tools/gdb_bthread_stack.py
(gdb) bthread_begin
Active bthreads: 3, will display 3 bthreads
Python Exception <class 'gdb.error'> No type "ResourcePool<bthread::TaskMeta>" within class or namespace "butil".:
Error occurred in Python: No type "ResourcePool<bthread::TaskMeta>" within class or namespace "butil".
(gdb) bthread_num
3

To Reproduce (复现方法)
编译example下的echo_c++/echo_server
执行echo_server
sudo gdb -p {pid}
然后如上面代码所示,加载gdb_bthread_stack.py,执行bthread_begin

Expected behavior (期望行为)
能够进入bthread debug mode

Versions (各种版本)
OS: ubuntu 20.04
Compiler: clang8
brpc: 1.8.0
protobuf: 3.15.8

Additional context/screenshots (更多上下文/截图)

@Huixxi
Copy link
Contributor

Huixxi commented Jul 7, 2024

编译的时候加了-g么?

@GreateCode
Copy link
Contributor

加了

@zhaoyulong
Copy link
Author

编译的时候加了-g么?

加了

@lorinlee
Copy link
Contributor

@zhaoyulong 有对二进制做strip吗,符号信息还完整不

@ehds
Copy link
Contributor

ehds commented Aug 9, 2024

try #2732

@zhaoyulong
Copy link
Author

try #2732

(gdb) source /home/yulong.zhao/brpc/tools/gdb_bthread_stack.py
(gdb) bthead_begin
Undefined command: "bthead_begin". Try "help".
(gdb) bthread_begin
warning: Could not find DWO CU bazel-out/k8-dbg/bin/_objs/brpc/controller.pic.dwo(0xfc070064084a248f) referenced by CU at offset 0x48e [in module /home/yulong.zhao/.cache/bazel/_bazel_yulong.zhao/7f7db11ae0bdba045225157f9735c648/execroot/_main/bazel-out/k8-dbg/bin/example/echo_c++_server]
Python Exception <class 'gdb.error'> No symbol "bthread" in current context.:
Error occurred in Python: No symbol "bthread" in current context.

@ehds
Copy link
Contributor

ehds commented Aug 19, 2024

try #2732

(gdb) source /home/yulong.zhao/brpc/tools/gdb_bthread_stack.py (gdb) bthead_begin Undefined command: "bthead_begin". Try "help". (gdb) bthread_begin warning: Could not find DWO CU bazel-out/k8-dbg/bin/_objs/brpc/controller.pic.dwo(0xfc070064084a248f) referenced by CU at offset 0x48e [in module /home/yulong.zhao/.cache/bazel/_bazel_yulong.zhao/7f7db11ae0bdba045225157f9735c648/execroot/_main/bazel-out/k8-dbg/bin/example/echo_c++_server] Python Exception <class 'gdb.error'> No symbol "bthread" in current context.: Error occurred in Python: No symbol "bthread" in current context.

能方便给个 echo_c++_server 的 bin 以及gdb的版本吗?我本地使用 ubuntu 20.04 + clang8+ gdb13.1/9.2 可以正常调试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants