• Stefan Hajnoczi's avatar
    scripts: add 'qemu coroutine' command to qemu-gdb.py · 9eddd6a4
    Stefan Hajnoczi authored
    The 'qemu coroutine <coroutine-address>' GDB command prints the
    backtrace for a CoroutineUContext.  This is useful for peeking inside
    yielded coroutines that are waiting for file descriptor events, timers,
    For example:
      $ gdb tests/test-coroutine
      (gdb) b test_yield
      (gdb) r
      (gdb) b qemu_coroutine_enter
      (gdb) c
      (gdb) c
      Breakpoint 2, qemu_coroutine_enter (co=0x555555c66520, opaque=0x0) at qemu-coroutine.c:103
      103	{
      (gdb) source scripts/qemu-gdb.py
      (gdb) qemu coroutine 0x555555c66520
      #0  0x000055555557a740 in qemu_coroutine_switch (from_=<optimized out>, to_=0x7ffff7f90a70, action=COROUTINE_YIELD) at coroutine-ucontext.c:177
      #1  0x0000555555566af9 in yield_5_times (opaque=0x7fffffffdbb7) at tests/test-coroutine.c:107
      #2  0x000055555557a7aa in coroutine_trampoline (i0=<optimized out>, i1=<optimized out>) at coroutine-ucontext.c:80
      #3  0x00007ffff08de000 in __start_context () at /lib64/libc.so.6
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Message-id: 1427409754-8556-1-git-send-email-stefanha@redhat.com
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>