From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28269 invoked by alias); 28 May 2012 21:19:58 -0000 Received: (qmail 28261 invoked by uid 22791); 28 May 2012 21:19:58 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 May 2012 21:19:41 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4SLJfvA012877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 28 May 2012 17:19:41 -0400 Received: from host2.jankratochvil.net (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4SLJbYU025942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 28 May 2012 17:19:40 -0400 Date: Mon, 28 May 2012 21:19:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] infrun: don't resume the inferior when we notice a new thread (new_thread_event). Message-ID: <20120528211937.GA14224@host2.jankratochvil.net> References: <20120528204623.25996.69879.stgit@brno.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120528204623.25996.69879.stgit@brno.lan> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-05/txt/msg01005.txt.bz2 On Mon, 28 May 2012 22:46:23 +0200, Pedro Alves wrote: > If anyone as any idea why things are done in the current way, please > speak up. Not much, just that linux-nat.c linux_handle_extended_wait has this code by you: if (non_stop) { /* Add the new thread to GDB's lists as soon as possible so that: if (!thread_db_attach_lwp (new_lp->ptid)) { /* We're not using thread_db. Add it to GDB's list. */ target_post_attach (GET_LWP (new_lp->ptid)); add_thread (new_lp->ptid); } And for !non_stop mode add_thread gets delayed till handle_inferior_event; which should not hurt. If this add would be done unconditionally in linux-nat.c then this handle_inferior_event would never be reached. But I do not see why to make that change, handle_inferior_event works. Thanks, Jan