Utilities to examine backtraces of coroutines in coredump files, that work with modified version of libcoro. Currently work in progress.
libcoro's coro_transfer
function is modified to save coroutine execution
state on each invocation. This state is saved into a table in process
address space, that can afterwards be read from a coredump file in
case of crash.
libcorostacks library is used to read coroutine state table and retrieve meaningful information about execution state. It uses elfutils under the hood for reading coredumps and stack unwinding.
print-coroutines is a simple program to output informaition obtained from libcorostacks.
Example program and modified libcoro can be found in demo directory.
The thing is that GDB currently has no support for green threads and can't
do unwinding outside of main stack without running process.
Link to discussion
sudo apt install libelf-dev libdw-dev
mkdir -p build
meson setup build --prefix=<where_to_install>
cd build
meson compile
meson install
Inside libcoro-dbg/build directory:
gdb demo/corodemo
&start
- launch demo with GDBCtrl+c
&gcore
after some time, to generate core fileq
- exit GDBprint-coroutines/print-coroutines core.<pid>
- print backtraces