[PATCH] D132240: [Coroutine][Debug] Add line and column number to suspension point id

Adrian Vogelsgesang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 10:07:24 PDT 2022


avogelsgesang added a comment.

> I think it may be better to discuss such topics in https://discourse.llvm.org so that more people could know this.

Good point! Posted this for discussion in https://discourse.llvm.org/t/rfc-debug-info-for-coroutine-suspension-locations/64721.
I also mention your concern around debug info size there.

> e.g., we can generate a map from the index to the line number and store such pairs. The we could get these values in debugging scripts.

I didn't completely understand this proposed alternative and hence didn't include it in the Discourse thread. If you could elaborate on this in the Discourse, that would be appreciated!

> and there generally only one bar() called in coro(), so we could get the suspended location.

yes, this works for a large number of simple coroutine usages. However, I tend to have multiple calls to `boost::asio::async_read` in the same coroutine and then it is no longer possible to use this trick.

Also, while this technique works nicely for people with a deep understanding on how coroutines work, I fear it requires too much technical knowledge for wide-spread adoption. I would prefer a "my debugger still works reasonably well, also if I use coroutines"-type of user experience.

> for the scripts to get the asynchronous stack, I have https://github.com/alibaba/async_simple/blob/main/dbg/LazyStack.py

Thanks for sharing! This is indeed very useful


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132240/new/

https://reviews.llvm.org/D132240



More information about the llvm-commits mailing list