From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23749 invoked by alias); 9 Oct 2018 14:22:59 -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 23738 invoked by uid 89); 9 Oct 2018 14:22:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Oct 2018 14:22:57 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A1F6D7D0E7; Tue, 9 Oct 2018 14:22:56 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF7AB17B26; Tue, 9 Oct 2018 14:22:55 +0000 (UTC) Subject: Re: RFC: using Ada tasks numbers with thread commands To: Joel Brobecker , gdb-patches@sourceware.org References: <20181009140902.GA3430@adacore.com> Cc: philippe.waroquiers@skynet.be From: Pedro Alves Message-ID: <77e1fe1b-35c5-b84b-1232-00f9faeffe49@redhat.com> Date: Tue, 09 Oct 2018 14:22:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181009140902.GA3430@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-10/txt/msg00213.txt.bz2 On 10/09/2018 03:09 PM, Joel Brobecker wrote: > Hello, > > Philippe and I were discussing how some Ada task commands, and > the lack of support for some functionalities that we have for > thread commands. For instance, we have "thread apply ...", and > Ada users usually prefer to iterate over Ada tasks rather than > threads. > > I was ready to work on implementing equivalent Ada commands, but > Philippe instead suggested that we just enhance the thread ID parsing > routines to recognize a special syntax that would signify the ID > is not a thread, but rather an Ada task. For instance, Philippe > suggested something like adding a 't' suffix (eg: 5t); I could > imagine something like 'a' for "Ada" instead, as 't' can be both > "thread" and "task", and we could play with making it a prefix > instead (eg: "a5"). So, existing thread commands would automatically > be able to handle Ada task numbers also. Eg: > > (gdb) thread apply 5a-7a bt > > What do you guys think of the idea? > > On my end, I have to say I have some reservations about this; > for a single Ada task, why not indeed; but for a range of tasks, > there is no guaranty that a range of Ada tasks maps to a range of > threads; nor that Ada tasks are going to be listed in the same > order as threads. > > That being said - if people are OK with the syntax above, I think > the issues I listed can be easily dealt with, but having the thread > ID parser expand the range into a list. > > But thinking out loud - what if the user used a hybrid range? Would > that make any kind of sense? If yes, how do you expand that, knowing > again that threads and Ada numbers do not necessarily have a linear > mapping. If feels like, at least to start with, we should not allow > that at all. > > Thoughts? > That's quite similar to what I implemented in my getting-old itsets branch ('t' for threads, 'c' for cores, 'i' for inferiors, 'a' for ada tasks), but after using it a while, I came to the conclusion that it isn't a very good idea. Ends up being confusing, complicated, and not easy to use ("why do I have to type all these 'a's all the time??"). Thanks, Pedro Alves