From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9189 invoked by alias); 29 Nov 2011 21:47:51 -0000 Received: (qmail 9177 invoked by uid 22791); 29 Nov 2011 21:47:48 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS 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; Tue, 29 Nov 2011 21:47:14 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pATLlBah011096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 Nov 2011 16:47:11 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pATLlBpb021838; Tue, 29 Nov 2011 16:47:11 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pATLl9WR021720; Tue, 29 Nov 2011 16:47:09 -0500 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [RFC/WIP PATCH 13/14] Make "thread apply all" only loop over threads in the current set References: <20111128153742.17761.21459.stgit@localhost6.localdomain6> <20111128154009.17761.49348.stgit@localhost6.localdomain6> Date: Tue, 29 Nov 2011 21:47:00 -0000 In-Reply-To: <20111128154009.17761.49348.stgit@localhost6.localdomain6> (Pedro Alves's message of "Mon, 28 Nov 2011 15:40:09 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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-11/txt/msg00833.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> This makes "thread apply all" only loop over threads in the current Pedro> set instead of always all threads. It seems to me that "thread apply" already has a thread argument, which could be syntactically extended to cope with sets: thread apply [1.*] print x Then I think the existing syntax can just be mapped to a set: thread apply 1 2 3 print x => thread apply [1,2,3] print x thread apply all print x => thread apply [*] print x (I didn't read the itset patch yet so I don't know if this is still the right syntax, but you get the idea.) If you considered this and rejected it, I would be interested in your reason. I am not strongly wedded to this idea. I wonder if your idea might be confusing for users, since "all" is an absolute word, but this patch makes it not so. Pedro> I think it might make sense to make "info threads" only list threads Pedro> of the current focus too. WDYT? If a command can determine whether it has an explicit prefix (and TBH I am not sure it is a good idea to allow this -- and I didn't read that patch yet either) then you could have it use the current focus if and only if the focus is explicit. That is: [1.*]> info thread => all threads [1.*]> [1.*] info thread => just threads in inferior 1 If there is a set meaning "the current focus set" you could: [1.*]> [$] info thread ... giving the current set some short moniker like "$" makes it easier to use. "info thread" takes thread arguments, so perhaps the same rewriting idea used above applies. This approach would work even without a command knowing whether it has explicit context: (gdb) info thread 1 2 3 => info thread [1,2,3] (gdb) info thread [$] => focused threads (gdb) info thread [1.*] => threads of inferior 1 In any case if these commands respect the focus set, then we also have to define what happens if they are passed explicit threads. Tom