A demo application for a CppCon24 talk: How Meta made Debugging Async Code Easier with Coroutines and Senders. The demo application's purpose is to showcase async stacks integration in Unifex.
The demo application requires
- liburing
- C++20
- lldb
- clang-18
- x86_64
We've tested this with clang-18; updated versions of clang may also be compatible. co_bt.py did work for GDB, but that has not been recently confirmed.
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-stdlib=libc++ -Wno-c++11-narrowing" -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++
In an .lldbinit file or when you start lldb in the cppcon24-async-demo repo, paste the following code:
command script import scripts/co_bt.py
In lldb, set the breakpoint on a line of code that will have a running async operation. Type
co_bt
to see the async stack at that breakpoint.
If there is no running async operation, you will see an error similar to the one below:
No async operation detected
This is a demo application for a CppCon talk so this repo will not be actively maintained. co_bt.py is a script maintained by folly. The co_bt.py included in this repo is purely for demo purposes.
See the CONTRIBUTING file for how to help out.
- co_bt.py is maintained by folly.
- This demo application is based off the AsyncStackRoot and AsyncStackFrame data stuctures maintained by folly.
- Unifex was a reference implementation for P2300 and is an open sourced C++ coroutines/sender library.
This project is made available under the Apache license, as found in the LICENSE.txt file.