This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Frame sniffers in Python/Guile/*
- From: Doug Evans <xdje42 at gmail dot com>
- To: Andy Wingo <wingo at igalia dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>, Alexander Smundak <asmundak at google dot com>, Pedro Alves <palves at redhat dot com>
- Date: Sun, 08 Mar 2015 13:03:13 -0700
- Subject: Re: Frame sniffers in Python/Guile/*
- Authentication-results: sourceware.org; auth=none
- References: <87d24r4jgx dot fsf at igalia dot com>
Andy Wingo <wingo@igalia.com> writes:
> [...]
>
> And so on. From what I can tell, all of this is because there is no
> selected frame. I recognize that this situation reflects reality in
> some way -- we're still building the selected frame -- but is there any
> way that we could have GDB be in a more "normal" state while the unwind
> callback is running?
I think one gets into trouble if one tries to
apply the word "normal" to gdb. :-)
Things like selected_frame and get_current_arch
are annoying, global state generally is.
Anything you can do untangle the need for global
state will be welcome.
But as you've observed, this is a bit of a special case.
Sometimes the architecture depends on the frame.
And until we know the architecture we don't know
what the registers are. And so on.
I don't have any simple suggestions. Maybe others will.
A lot of times improving/fixing gdb requires first
improving/fixing several other parts first.
Welcome to gdb. :-)