From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27669 invoked by alias); 28 Dec 2010 11:00:37 -0000 Received: (qmail 27657 invoked by uid 22791); 28 Dec 2010 11:00:37 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Dec 2010 11:00:33 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6C02E2BAB19; Tue, 28 Dec 2010 06:00:31 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BtNT4FCTtuYy; Tue, 28 Dec 2010 06:00:31 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id EEFA12BAB05; Tue, 28 Dec 2010 06:00:30 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 00E92145870; Tue, 28 Dec 2010 15:00:24 +0400 (RET) Date: Tue, 28 Dec 2010 11:26:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 5/8] inf-ttrace: Determine attached process LWP immediately after attaching. Message-ID: <20101228110024.GA2436@adacore.com> References: <1293511386-7384-1-git-send-email-brobecker@adacore.com> <1293511386-7384-6-git-send-email-brobecker@adacore.com> <201012281030.11261.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012281030.11261.pedro@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-12/txt/msg00503.txt.bz2 > > This works on PA/HP-UX, because we immediately perform a wait to pop > > the event triggered by the attach. We can use that event to extract > > the thread's LWP. But this does not work for IA64/HP-UX, because > > the attach no longer triggers an event, and thus a wait should NOT > > be performed (such a wait would simply block indefinitely). > > How you can get by without setting target_attach_no_wait then? There is a global variable inf_ttrace_num_lwps that inf_ttrace_wait checks to see if it needs to set the main thread's tid. The thread iteration loop that I'm adding increments that counter every time I add a new thread, so the code doesn't trigger in the "attach" case. But it still does when doing a "run". -- Joel