From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23973 invoked by alias); 10 May 2008 22:12:46 -0000 Received: (qmail 23964 invoked by uid 22791); 10 May 2008 22:12:45 -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; Sat, 10 May 2008 22:12:19 +0000 Received: from kahikatea.snap.net.nz (7.63.255.123.dynamic.snap.net.nz [123.255.63.7]) by viper.snap.net.nz (Postfix) with ESMTP id CB35D3DA00C; Sun, 11 May 2008 10:12:11 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 942048FC6D; Sun, 11 May 2008 10:12:10 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18470.7609.400548.29643@kahikatea.snap.net.nz> Date: Sun, 11 May 2008 14:10:00 -0000 To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Report the main thread. In-Reply-To: References: <18469.39280.284106.858072@kahikatea.snap.net.nz> 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-05/txt/msg00346.txt.bz2 > > Now that Joel has requested that I use observer_attach_new_thread for > > annotations this approach doesn't only produce MI output so it needs to > > be conditioned on MI: > > > > @@ -124,6 +124,10 @@ add_thread_silent (ptid_t ptid) > > tp->num = ++highest_thread_num; > > tp->next = thread_list; > > thread_list = tp; > > + > > + if (ui_out_is_mi_like_p (uiout)) > > + observer_notify_new_thread (tp); > > This patch, IIUC, will cause the new_thread observer to be notified only > in MI mode. Then, no observer except for MI one will ever be called? > Then, why those non-MI observers exist? > > Or to put in other way, I think this patch will make you annotation > observers to be never called. Is this what you want? Yes, you're right. I didn't notice that the observer in add_thread_with_info was removed at the same time this one was added. I just want threads other than the main thread to be reported, as used to be the case. That way I can create a threads buffer and display the thread number when there is more than one thread. Putting observer_notify_new_thread back in add_thread_with_info like this would work: if (!ui_out_is_mi_like_p (uiout)) observer_notify_new_thread (tp); but it might be cleaner if I applied my original patch. -- Nick http://www.inet.net.nz/~nickrob