From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26499 invoked by alias); 4 Dec 2008 15:54:10 -0000 Received: (qmail 26486 invoked by uid 22791); 4 Dec 2008 15:54:09 -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; Thu, 04 Dec 2008 15:53:24 +0000 Received: (qmail 28082 invoked from network); 4 Dec 2008 15:52:52 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Dec 2008 15:52:52 -0000 From: Pedro Alves To: "Ulrich Weigand" Subject: Re: [RFA] dummy frame handling cleanup, plus inferior fun call signal handling improvement Date: Thu, 04 Dec 2008 15:54:00 -0000 User-Agent: KMail/1.9.10 Cc: Doug Evans , gdb-patches@sourceware.org References: <200812041531.mB4FVEKt030233@d12av02.megacenter.de.ibm.com> In-Reply-To: <200812041531.mB4FVEKt030233@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: <200812041553.37386.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/msg00070.txt.bz2 On Thursday 04 December 2008 15:31:14, Ulrich Weigand wrote: > Hmmm, that's not quite what what the code actually does. =A0The state is = also > restored if some error is thrown during the proceed call, for example. > I'm not sure whether this is really the right thing to do ... And it *can happen* (although it should be rare) that when the exception is thrown, inferior_ptid is set to a different ptid the infcall started with (say, while you're handling a thread specific breakpoint hitting the w= rong thread), so, the cleanup can still write the context back, the wrong thread. Thread= ing and infcalls failing is a clear mess. Thinking out loud, I wonder if we shouldn't be storing the thread state prior to the infcall in struct thread_info itself, and leave out in a separate object only the session state (what doesn't make sense to have in thread_info). So, a thread_info would hold two objects of the same type, something like, thread_info->infrun_state, thread_info->stored_infrun_state. If a thread exits, (or the whole inferior) while doing the infcall, the state is automatically deleted/discarded when you delete the thread. If an exception is thrown, you'd go through all threads and set the infrun_state from the stored_infrun_state, if there's any. --=20 Pedro Alves