qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] scripts/qemugdb: support coroutine backtrace in


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-devel] [PATCH] scripts/qemugdb: support coroutine backtrace in coredumps
Date: Mon, 9 Apr 2018 16:01:24 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

04.04.2018 13:34, Stefan Hajnoczi wrote:
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())

strange, but it doesn't work. it prints the same backtrace, as if I just call bt. (I applied it onto "[PATCH 2/4] scripts/qemugdb: improve "qemu coroutine" command")

also, I can just call select-frame with zeros or any garbage in gdb, with same effect:
(gdb) select-frame 0 0
(gdb) bt

and get same backtrace.

so, bt command not related to selected frame. also, up and down commands don't help too, they go to frames in current bt, instead of moving relatively to selected frame.

--
Best regards,
Vladimir




reply via email to

[Prev in Thread] Current Thread [Next in Thread]