From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25100 invoked by alias); 23 May 2011 10:51:47 -0000 Received: (qmail 25092 invoked by uid 22791); 23 May 2011 10:51:47 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 May 2011 10:51:33 +0000 Received: (qmail 11869 invoked from network); 23 May 2011 10:51:32 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 May 2011 10:51:32 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH, gdbserver] Scan for existing threads during attachment on Linux Date: Mon, 23 May 2011 10:51:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: lgustavo@codesourcery.com References: <201105231137.53423.pedro@codesourcery.com> In-Reply-To: <201105231137.53423.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201105231151.29472.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: 2011-05/txt/msg00519.txt.bz2 Sorry, I missed this before. On Monday 23 May 2011 11:37:53, Pedro Alves wrote: > > + /* Mark the threads as stopped. */ > > + if (!non_stop) > > + for_each_inferior (&all_threads, set_resume_kind_stop); You don't want to do this to all_threads. You want to do this to the threads of PID. Might as well do it in the loop you've added, right after attaching to each lwp? There's a comment in linux_attach_lwp_1 that is now stale: > ??? If the process already has several threads we leave the other > threads running. Pedro Alves