From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12058 invoked by alias); 7 Dec 2008 01:24:29 -0000 Received: (qmail 12050 invoked by uid 22791); 7 Dec 2008 01:24:29 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 07 Dec 2008 01:23:39 +0000 Received: (qmail 13839 invoked from network); 7 Dec 2008 01:23:37 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Dec 2008 01:23:37 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [rfc] [2/7] infrun cleanup: miscellaneous cleanups Date: Sun, 07 Dec 2008 01:24:00 -0000 User-Agent: KMail/1.9.10 Cc: "Ulrich Weigand" References: <200812070017.mB70HagV018378@d12av02.megacenter.de.ibm.com> In-Reply-To: <200812070017.mB70HagV018378@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200812070123.40787.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-12/txt/msg00126.txt.bz2 On Sunday 07 December 2008 00:17:36, Ulrich Weigand wrote: > This patch changes wait_for_inferior to *always* invalidate > registers (and overlay cache state) before every call to target_wait, > and removes this from prepare_to_wait and handle_inferior_event. I welcome this bit in particular very much. I know I was confused by this when I first learnt about expedite registers. > * fetch_inferior_event uses the contents of ecs->ptid and > ecs->event_thread after handle_inferior_event returns. As later > patches will remove those fields, I've replaced them with accessing > the current inferior -- just like normal_stop, which is called > by fetch_inferior_event anyway, does as well. Yes, but not through current_inferior. On Sunday 07 December 2008 00:17:36, Ulrich Weigand wrote: > =A0 =A0if (!ecs->wait_some_more) > =A0 =A0 =A0{ > - =A0 =A0 =A0struct inferior *inf =3D find_inferior_pid (ptid_get_pid (ec= s->ptid)); > + =A0 =A0 =A0struct inferior *inf =3D current_inferior (); > =A0 Please change this bit to: - struct inferior *inf =3D find_inferior_pid (ptid_get_pid (ecs->ptid)= ); + struct inferior *inf =3D find_inferior_pid (ptid_get_pid (inferior_p= tid)); Although inferior_ptid is pointing ecs->ptid at this point, current_inferior asserts if the inferior is not listed, which does happen t= oday. See this just below: /* We may not find an inferior if this was a process exit. */ if (inf =3D=3D NULL || inf->stop_soon =3D=3D NO_STOP_QUIETLY) normal_stop (); I've got patches that fix the targets to not do that, so I can revisit this bit by then. --=20 Pedro Alves