This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [Qemu-devel] [PATCH] scripts/qemugdb: support coroutine backtrace in coredumps
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simark at simark dot ca>, Stefan Hajnoczi <stefanha at gmail dot com>, Vladimir Sementsov-Ogievskiy <vsementsov at virtuozzo dot com>
- Cc: Stefan Hajnoczi <stefanha at redhat dot com>, qemu-devel at nongnu dot org, gdb at sourceware dot org
- Date: Mon, 23 Apr 2018 14:28:16 +0100
- Subject: Re: [Qemu-devel] [PATCH] scripts/qemugdb: support coroutine backtrace in coredumps
- References: <20180404103440.19546-1-stefanha@redhat.com> <008ac6e8-1e68-b0f6-7e75-77453721d031@virtuozzo.com> <20180410020823.GB11203@stefanha-x1.localdomain> <fefd54c0-d5f2-dc31-ff3c-24eb29fd2101@simark.ca>
On 04/23/2018 02:37 AM, Simon Marchi wrote:
> On 2018-04-09 10:08 PM, Stefan Hajnoczi wrote:
>> I wonder what the point of select-frame is then...
>>
>> I have CCed the GDB mailing list. Maybe someone can help us. Context:
>>
>> QEMU implements coroutines using jmpbuf. We'd like to print coroutine
>> call stacks in GDB and have a script that works when a process is being
>> debugged (it sets the registers).
>>
>> Now we'd like to extend the script to work on core dumps where it's not
>> possible to set registers (since there is no process being debugged).
>>
>> Is there a way to backtrace an arbitrary call stack in a core dump?
>
> Not that I know of. The "frame <stack-addr> <pc-addr>" form of the frame
> command sounds like it should be usable to achieve that, but it doesn't
> seem to work in that way. I really wonder if it's working as it was
> intended initially. I guess using that form of the frame command should
> override/mask the real current values of $sp and $pc?
Yeah, "frame <args>" has a lot of problems.
This series was working toward sorting out the "frame" command:
https://sourceware.org/ml/gdb-patches/2015-09/msg00248.html
Follow the urls there for more background.
To me, the important questions to answer are here:
https://sourceware.org/ml/gdb-patches/2015-09/msg00658.html
Unfortunately, I don't think the series moved past that point.
Thanks,
Pedro Alves