From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: pedro@codesourcery.com (Pedro Alves)
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] [2/7] infrun cleanup: miscellaneous cleanups
Date: Sun, 07 Dec 2008 18:23:00 -0000 [thread overview]
Message-ID: <200812071823.mB7IN6TL005725@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <200812071719.24947.pedro@codesourcery.com> from "Pedro Alves" at Dec 07, 2008 05:19:24 PM
Pedro Alves:
> On Sunday 07 December 2008 01:23:40, Pedro Alves wrote:
> > On Sunday 07 December 2008 00:17:36, Ulrich Weigand wrote:
> > > if (!ecs->wait_some_more)
> > > {
> > > - struct inferior *inf =3D find_inferior_pid (ptid_get_pid (ecs->p=
> tid));
> > > +=20=20=20=20=20=20
> > Please change this bit to:
> >=20
> > - =A0 =A0 =A0struct inferior *inf =3D find_inferior_pid (ptid_get_pid (ec=
> s->ptid));
> > + =A0 =A0 =A0struct inferior *inf =3D find_inferior_pid (ptid_get_pid (in=
> ferior_ptid));
>
> Looking again, it would be more correct (and safest as it doesn't change cu=
> rrent
> behaviour) to leave it as ptid_get_pid(ecs->ptid) in this patch, and change=
> it
> to ptid_get_pid (ptid) in the last patch (the event ptid).
Well, I was concerned about the cases where today handle_inferior_event
*modifies* the ecs->ptid it gets as input (e.g. thread-hopping or switching
back to the single-stepped thread). I'm not sure if that can today actually
ever cause it switch to a different *inferior*, but it appears it could.
Using simply the caller's ptid means we will miss that switch. Using
inferior_ptid should catch it, however, as handle_inferior_event will
have done a switch_to_thread in addition to changing ecs->ptid.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2008-12-07 18:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-07 0:18 Ulrich Weigand
2008-12-07 1:24 ` Pedro Alves
2008-12-07 17:19 ` Pedro Alves
2008-12-07 18:23 ` Ulrich Weigand [this message]
2008-12-07 19:04 ` Pedro Alves
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=200812071823.mB7IN6TL005725@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.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