[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] scripts/qemugdb: support coroutine backtrace in cor
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH] scripts/qemugdb: support coroutine backtrace in coredumps |
Date: |
Wed, 4 Apr 2018 11:34:40 +0100 |
Use the 'select-frame' GDB command to switch stacks instead of manually
setting the debugged thread's registers (this only works when debugging
a live process, not in a coredump).
Cc: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
Vladimir: Does this work for you?
scripts/qemugdb/coroutine.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/scripts/qemugdb/coroutine.py b/scripts/qemugdb/coroutine.py
index ab699794ab..ed96434aee 100644
--- a/scripts/qemugdb/coroutine.py
+++ b/scripts/qemugdb/coroutine.py
@@ -77,13 +77,11 @@ def bt_jmpbuf(jmpbuf):
for i in regs:
old[i] = gdb.parse_and_eval('(uint64_t)$%s' % i)
- for i in regs:
- gdb.execute('set $%s = %s' % (i, regs[i]))
+ gdb.execute('select-frame %s %s' % (regs['rsp'], regs['rip']))
gdb.execute('bt')
- for i in regs:
- gdb.execute('set $%s = %s' % (i, old[i]))
+ gdb.execute('select-frame %s %s' % (old['rsp'], old['rip']))
def coroutine_to_jmpbuf(co):
coroutine_pointer = co.cast(gdb.lookup_type('CoroutineUContext').pointer())
--
2.14.3
- [Qemu-devel] [PATCH] scripts/qemugdb: support coroutine backtrace in coredumps,
Stefan Hajnoczi <=