async_simple icon indicating copy to clipboard operation
async_simple copied to clipboard

Need more debug tools.

Open foreverhy opened this issue 2 years ago • 6 comments

Search before asking

  • [X] I searched the issues and found no similar issues.

What happened + What you expected to happen

Debugging Lazy<> is quite difficult since may commands are not well supported in gdb.

Reproduction way

Anything else

Are you willing to submit a PR?

  • [ ] Yes I am willing to submit a PR!

foreverhy avatar Nov 14 '22 08:11 foreverhy

这个文档是可用的吗?https://github.com/alibaba/async_simple/blob/main/docs/docs.cn/调试%20Lazy.md

ChuanqiXu9 avatar Nov 14 '22 08:11 ChuanqiXu9

目前主要还是这几类 debug 的问题比较难用:

  1. gdb step 进入 coro 调用里
  2. gdb up/down 在 coro 间切换
  3. print 某个变量(local 或 class 成员变量)

foreverhy avatar Nov 14 '22 08:11 foreverhy

目前主要还是这几类 debug 的问题比较难用:

  1. gdb step 进入 coro 调用里
  2. gdb up/down 在 coro 间切换
  3. print 某个变量(local 或 class 成员变量)

1 和 2 在原理上没法实现,因为异步执行的话很可能执行的栈帧已经不在栈上了。3 的话 clang15(或内部 clang13) 配合这个文档在 debug 模式下应该是可以完全支持的;在 Release 模式下的话,也能看到优化后的值,但可能这个名字和前端的名字就可能对不上了

ChuanqiXu9 avatar Nov 14 '22 08:11 ChuanqiXu9

优化的情况可以看看这个文档:https://clang.llvm.org/docs/DebuggingCoroutines.html#examples-to-print-coroutine-frames

ChuanqiXu9 avatar Nov 14 '22 08:11 ChuanqiXu9

uthread有gdb脚本么

4kangjc avatar Nov 14 '22 11:11 4kangjc

uthread有gdb脚本么

uthread 不需要吧,按原来的就行了

ChuanqiXu9 avatar Nov 14 '22 13:11 ChuanqiXu9