|
wrote notes into https://docs.google.com/document/d/1-Q8XunNWffxk5vQMx46b5wUTUaSpki90m_GVKDgpogM
V4 toolchain GDB doesn’t understand how to demangle coroutine frame names.
The debugger displays the function name inside a coroutine as something like:
#0 mongo::(anonymous namespace)::fib(mongo::(anonymous namespace)::_ZN5mongo12_GLOBAL__N_13fibEPSt6vectorIiSaIiEE.frame *) (frame_ptr=0x7ffff7f9e3a0) at src/mongo/platform/coroutines_test.cpp:125
|
So coroutine_handle::operator() calls its resume member, which calls a compiler-generated blahblah.frame function with a frame_ptr object, the contents of which are obscure compiler-generated details. However, `info locals` will show local variables within the coroutine, but it also shows a few weird extra things injected by the codegen somehow.
(gdb) print frame_ptr
|
$1 = (mongo::(anonymous namespace)::_ZN5mongo12_GLOBAL__N_13fibEPSt6vectorIiSaIiEE.frame *) 0x7ffff7f9e3a0
|
(gdb) print *frame_ptr
|
$2 = {__resume = 0x55555610e647 <mongo::(anonymous namespace)::fib(mongo::(anonymous namespace)::_ZN5mongo12_GLOBAL__N_13fibEPSt6vectorIiSaIiEE.frame *)>,
|
__destroy = 0x55555610ea0a <mongo::(anonymous namespace)::fib(mongo::(anonymous namespace)::_ZN5mongo12_GLOBAL__N_13fibEPSt6vectorIiSaIiEE.frame *)>, __p = {<No data fields>}, __frame_needs_free = true, __resume_at = 6,
|
__self_h = {_M_fr_ptr = 0x7ffff7f9e3a0}, __parm.results = 0x7fffffffdc20, __i_a_r_c.1.1 = true, __Is.2.2 = {<No data fields>}, __a.2.3 = 1, __b.2.3 = 2, __Aw0.3.4 = {<No data fields>}, __Aw1.4.6 = {<No data fields>},
|
__Fs.2.7 = {<No data fields>}}
|
(gdb) print a
|
$3 = 0
|
(gdb) print b
|
$4 = 1
|
(gdb) info locals
|
Aw1 = <optimized out>
|
i_a_r_c = false
|
Is = <optimized out>
|
a = 0
|
b = 1
|
Aw0 = <optimized out>
|
Fs = <optimized out>
|
(gdb)
|
|