From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20330 invoked by alias); 1 Oct 2013 10:02:03 -0000 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 Received: (qmail 20321 invoked by uid 89); 1 Oct 2013 10:02:03 -0000 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 01 Oct 2013 10:02:03 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3E50411664C; Tue, 1 Oct 2013 06:02:19 -0400 (EDT) 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 ChWui7+izlmo; Tue, 1 Oct 2013 06:02:19 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 12DC411664A; Tue, 1 Oct 2013 06:02:19 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 34063E0486; Tue, 1 Oct 2013 12:02:00 +0200 (CEST) Date: Tue, 01 Oct 2013 10:02:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [RFA/gdbserver/LynxOS]: Incomplete thread list after --attach Message-ID: <20131001100200.GA2840@adacore.com> References: <1380621039-25204-1-git-send-email-brobecker@adacore.com> <524A9C9E.2040407@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <524A9C9E.2040407@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-10/txt/msg00026.txt.bz2 > > Unfortunately, as the added comments hints, there appears to be > > no way of getting the list of threads via ptrace, other than by > > spawning the "ps" command, and parsing its output. Not great, > > but it appears to be the best we can do. This method was actually > > inspired by looking at old code which did exactly that. > > Huh. I didn't really look at the patch yet, but, then, how > does "ps" manage to work? If you strace "ps", what system calls > is it using? I'd imagine if not ptrace, then it would be reading > /proc or some such? I can look. But what strongly detered me from doing that is the fact that it'd be starting to use unpublished interfaces. Running "ps" isn't pretty, but I can hope it'll keep working across versions of Lynx (we tested against Lynx 178 and 5.x, knowing that this has worked with 4.x as well). -- Joel