qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] scripts/qemugdb: support coroutine backtrace in coredumps
@ 2018-04-04 10:34 Stefan Hajnoczi
  2018-04-09 13:01 ` Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Hajnoczi @ 2018-04-04 10:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Vladimir Sementsov-Ogievskiy, Stefan Hajnoczi

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 <vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-01-02 14:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-04 10:34 [Qemu-devel] [PATCH] scripts/qemugdb: support coroutine backtrace in coredumps Stefan Hajnoczi
2018-04-09 13:01 ` Vladimir Sementsov-Ogievskiy
2018-04-10  2:08   ` Stefan Hajnoczi
2018-04-23  1:37     ` Simon Marchi
2018-04-23  9:33       ` Stefan Hajnoczi
2018-04-23  9:48         ` Vladimir Sementsov-Ogievskiy
2018-04-23 13:28       ` Pedro Alves
2018-12-27 17:36         ` Vladimir Sementsov-Ogievskiy
2019-01-02 14:01           ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).