From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32523 invoked by alias); 30 Apr 2008 07:54:38 -0000 Received: (qmail 32512 invoked by uid 22791); 30 Apr 2008 07:54:37 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Apr 2008 07:54:12 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Jr78g-0001ny-Iw for gdb-patches@sources.redhat.com; Wed, 30 Apr 2008 07:54:06 +0000 Received: from 78.158.192.230 ([78.158.192.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Apr 2008 07:54:06 +0000 Received: from vladimir by 78.158.192.230 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Apr 2008 07:54:06 +0000 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: [RFA] Report the main thread. Date: Wed, 30 Apr 2008 10:11:00 -0000 Message-ID: References: <200804262005.18646.vladimir@codesourcery.com> <200804261617.m3QGH9dv027362@brahms.sibelius.xs4all.nl> <20080426185448.GA14511@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.5 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-04/txt/msg00687.txt.bz2 Vladimir Prus wrote: > Daniel Jacobowitz wrote: > >> On Sat, Apr 26, 2008 at 08:44:23PM +0400, Vladimir Prus wrote: >>> Will some approach that only produce MI output be fine with you? >> >> Perhaps that means any observer for a new MI thread should go in >> add_thread_silent? > > Yes, moving the observer call to add_thread_silent is the most > direct approach to make MI work the way I want without disturbing CLI. Here's a patch to that effect. OK? * thread.c (add_thread): Move observer call to ... (add_thread_silent): ... here. --- gdb/thread.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gdb/thread.c b/gdb/thread.c index 46e6ba7..d3cfb32 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -124,6 +124,9 @@ add_thread_silent (ptid_t ptid) tp->num = ++highest_thread_num; tp->next = thread_list; thread_list = tp; + + observer_notify_new_thread (tp); + return tp; } @@ -136,8 +139,6 @@ add_thread_with_info (ptid_t ptid, struct private_thread_info *private) if (print_thread_events) printf_unfiltered (_("[New %s]\n"), target_pid_to_str (ptid)); - - observer_notify_new_thread (result); return result; }