From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19564 invoked by alias); 10 Jun 2008 03:13:37 -0000 Received: (qmail 19549 invoked by uid 22791); 10 Jun 2008 03:13:35 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Jun 2008 03:13:04 +0000 Received: from kahikatea.snap.net.nz (215.60.255.123.dynamic.snap.net.nz [123.255.60.215]) by viper.snap.net.nz (Postfix) with ESMTP id 249343D9FF5; Tue, 10 Jun 2008 15:13:02 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 252C78FC6D; Tue, 10 Jun 2008 15:12:48 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18509.61742.680365.176465@kahikatea.snap.net.nz> Date: Tue, 10 Jun 2008 06:39:00 -0000 To: Pedro Alves Cc: gdb-patches@sourceware.org, ghost@cs.msu.su Subject: Re: [patch:MI] Observer for thread-changed In-Reply-To: <200806100346.33522.pedro@codesourcery.com> References: <18509.7945.19078.399646@kahikatea.snap.net.nz> <200806100104.28694.pedro@codesourcery.com> <18509.57602.879804.675918@kahikatea.snap.net.nz> <200806100346.33522.pedro@codesourcery.com> X-Mailer: VM 7.19 under Emacs 22.2.50.2 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-06/txt/msg00189.txt.bz2 > > If it goes at the end of do_captured_thread_select then I guess that will > > be after any exceptions but, to me, putting the logic in gdb_thread_select > > makes it clearer that the thread only gets reported when there is no > > exception. > > I think it's clearer to put the observer close to where to switch > is performed. Plus, if/when we remove libgdb and the wrapper, we > have again to move the observer call... Not the end of the world, but > might as well put it in the right place now, IMHO. Oh well, opinions :-) Seems reasonable. I'll do that. -- Nick http://www.inet.net.nz/~nickrob --- thread.c 09 Jun 2008 21:06:46 +1200 1.71 +++ thread.c 10 Jun 2008 15:11:13 +1200 @@ -738,7 +738,6 @@ thread_command (char *tidstr, int from_t return; } - annotate_thread_changed (); gdb_thread_select (uiout, tidstr, NULL); } @@ -770,6 +769,8 @@ do_captured_thread_select (struct ui_out error (_("Thread ID %d has terminated."), num); switch_to_thread (tp->ptid); + observer_notify_thread_changed (); + annotate_thread_changed (); ui_out_text (uiout, "[Switching to thread "); ui_out_field_int (uiout, "new-thread-id", pid_to_thread_id (inferior_ptid));