diff options
author | Adrian Vogelsgesang <avogelsgesang@salesforce.com> | 2025-10-09 18:06:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-10 03:06:21 +0200 |
commit | 6e784afcb5a75b60ccb9bd74f9e0033787a01282 (patch) | |
tree | fcd83cad0cb2630739fd4712dcfba4fd1b30a429 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 69f913821d82f82cce3309da84b21375d5a128ee (diff) | |
download | llvm-6e784afcb5a75b60ccb9bd74f9e0033787a01282.zip llvm-6e784afcb5a75b60ccb9bd74f9e0033787a01282.tar.gz llvm-6e784afcb5a75b60ccb9bd74f9e0033787a01282.tar.bz2 |
[docs][coroutines] Update gdb debugger script (#162145)
In "Debugging C++ Coroutines", we provide a gdb script to aid with
debugging C++ coroutines in gdb. This commit updates said script to make
it easier to use and more robust.
The commit contains the following user-facing changes:
* `show-coro-frame` was replaced by a pretty-printer for
`std::coroutine_handle`. This is much easier to use than a custom
command since it works out-of-the-box with `p` and in my IDE's variable
view (tested using VS-Code)
* the new `get_coro_{frame,promise}` functions can be called from
expressions to access nested members. Example: `p
get_coro_promise(fib.coro_hdl)->current_state`
* `async-bt` was replaced by a frame filter. This way, the builtin `bt`
command directly shows all the async coroutine frames.
Under the covers, the script became more robust:
* For devirtualization, we now look up the `__coro_frame` variable in
the resume function instead of relying on the `.coro_frame_ty` naming
convention. Thereby, devirtualization works slightly better also on
gcc-compiled binaries (however, there is still more work to be done).
* We use the LLVM-generated `__coro_resume_<N>` labels to get the exact
line at which a coroutine was suspended.
* The continuation handle is now looked up by name instead of via
dereferencing a calculated pointer. Thereby, the script should be
simpler to adjust for various coroutine libraries without requiring
pointer arithmetic hacks.
Other sections of the documentation were adjusted accordingly to reflect
the newly added features of the gdb script.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions