From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: Keith Seitz <keiths@redhat.com>,
Michael Snyder <msnyder@vmware.com>,
swagiaal@redhat.com, oguzkayral@gmail.com
Subject: Re: New testsuite errors with gdbserver (remote)
Date: Fri, 18 Feb 2011 19:30:00 -0000 [thread overview]
Message-ID: <201102181930.30941.pedro@codesourcery.com> (raw)
In-Reply-To: <4D5D8974.5030205@redhat.com>
On Thursday 17 February 2011 20:47:48, Keith Seitz wrote:
> On 02/17/2011 10:48 AM, Michael Snyder wrote:
> > Somewhat to my surprise, these new failures narrow down to this change:
>
> I've given this a peek, and here's what I've found out...
>
> When the exit notification is sent, and python picks it up, it is
> setting up the python environment (architecture and language). The
> python exit callback does this by calling get_current_arch.
>
> The problem is that (long before this) wait_for_inferior sets the
> inferior with TID = 0. It is this inferior object that is then passed
> around for the event notification. Alas, unlike natives, where the
> inferior is popped, the inferior is still around.
>
> As a result, target_has_stack goes to check the thread status and cannot
> find the appropriate thread (since the one in the list hasn't been
> cleared). This leads to the internal error you're seeing.
>
> I'm not sure how valid it is to call get_current_arch from an exit
> event. Maybe it is. Maybe it isn't. Someone who knows a lot more about
> this is going to have to investigate this or guide me.
/* Return "current" architecture. If the target is running, this is
the architecture of the selected frame. Otherwise, the "current"
architecture defaults to the target architecture.
This function should normally be called solely by the command
interpreter routines to determine the architecture to execute a
command in. */
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct gdbarch *
get_current_arch (void)
The exited observer are called at other times, not when
preparing to execute a command in. It is quite bogus to assume
the current architecture, frame and language have anything to do
with the inferior that has been passed is as argument to the
observer.
> @@ -116,7 +116,7 @@ python_inferior_exit (struct inferior *i
> ptid_t ptidp;
> struct target_waitstatus status;
>
> - cleanup = ensure_python_env (get_current_arch (), current_language);
> + cleanup = ensure_python_env (target_gdbarch, current_language);
>
> get_last_target_status (&ptidp, &status);
I can't say that I'm very familiar with most of the python layer
code, but, why does this observer need to call ensure_python_env
in the first place? Or if it does, why doesn't it call it with
python_gdbarch like other places in py-inferior that are internal
helpers, not implementing a user command?
--
Pedro Alves
prev parent reply other threads:[~2011-02-18 19:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-17 0:55 Michael Snyder
2011-02-17 1:09 ` Michael Snyder
2011-02-17 2:08 ` Michael Snyder
2011-02-17 18:48 ` Michael Snyder
2011-02-17 20:48 ` Keith Seitz
2011-02-18 16:48 ` [RFA] Fix for " Pierre Muller
2011-02-18 19:30 ` Pedro Alves [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201102181930.30941.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb@sourceware.org \
--cc=keiths@redhat.com \
--cc=msnyder@vmware.com \
--cc=oguzkayral@gmail.com \
--cc=swagiaal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox