From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19729 invoked by alias); 9 Jun 2008 13:28:47 -0000 Received: (qmail 19712 invoked by uid 22791); 9 Jun 2008 13:28:46 -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.31) with ESMTP; Mon, 09 Jun 2008 13:28:28 +0000 Received: (qmail 19967 invoked from network); 9 Jun 2008 13:28:27 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Jun 2008 13:28:27 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch:MI] Observer for thread-changed Date: Mon, 09 Jun 2008 13:36:00 -0000 User-Agent: KMail/1.9.9 Cc: Nick Roberts , gdb-patches@sources.redhat.com, ghost@cs.msu.su References: <18509.7945.19078.399646@kahikatea.snap.net.nz> In-Reply-To: <18509.7945.19078.399646@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200806091428.29157.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-06/txt/msg00157.txt.bz2 Sorry, if I missed the discussion on it, but, A Monday 09 June 2008 13:16:09, Nick Roberts wrote: > =A0 =A0annotate_thread_changed (); > =A0 =A0gdb_thread_select (uiout, tidstr, NULL); > + =A0observer_notify_thread_changed (); > =A0} This is conceptually not right. gdb_thread_select is a libgdb function, that filters exceptions. If do_captured_thread_select throws an error, you will still call the observer. Plus,=20 do_captured_thread_select is already printing the thread change to MI, which means you'll get the output twice now, in MI? Why not call the observer from inside do_captured_thread_select, instead of on both CLI and MI commands? --=20 Pedro Alves From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19728 invoked by alias); 9 Jun 2008 13:28:47 -0000 Received: (qmail 19711 invoked by uid 22791); 9 Jun 2008 13:28:46 -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.31) with ESMTP; Mon, 09 Jun 2008 13:28:28 +0000 Received: (qmail 19967 invoked from network); 9 Jun 2008 13:28:27 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Jun 2008 13:28:27 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch:MI] Observer for thread-changed Date: Mon, 09 Jun 2008 13:28:00 -0000 User-Agent: KMail/1.9.9 Cc: Nick Roberts , gdb-patches@sources.redhat.com, ghost@cs.msu.su References: <18509.7945.19078.399646@kahikatea.snap.net.nz> In-Reply-To: <18509.7945.19078.399646@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-ID: <200806091428.29157.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-06/txt/msg00156.txt.bz2 Message-ID: <20080609132800.Cvy0KRBycbbG2zIoWDbZgdf5QwCEr-xMsFwpNugp9v4@z> Sorry, if I missed the discussion on it, but, A Monday 09 June 2008 13:16:09, Nick Roberts wrote: > =A0 =A0annotate_thread_changed (); > =A0 =A0gdb_thread_select (uiout, tidstr, NULL); > + =A0observer_notify_thread_changed (); > =A0} This is conceptually not right. gdb_thread_select is a libgdb function, that filters exceptions. If do_captured_thread_select throws an error, you will still call the observer. Plus,=20 do_captured_thread_select is already printing the thread change to MI, which means you'll get the output twice now, in MI? Why not call the observer from inside do_captured_thread_select, instead of on both CLI and MI commands? --=20 Pedro Alves