public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Cc: philippe.waroquiers@skynet.be
Subject: Re: RFC: using Ada tasks numbers with thread commands
Date: Tue, 09 Oct 2018 14:22:00 -0000	[thread overview]
Message-ID: <77e1fe1b-35c5-b84b-1232-00f9faeffe49@redhat.com> (raw)
In-Reply-To: <20181009140902.GA3430@adacore.com>

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

      reply	other threads:[~2018-10-09 14:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09 14:09 Joel Brobecker
2018-10-09 14:22 ` Pedro Alves [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77e1fe1b-35c5-b84b-1232-00f9faeffe49@redhat.com \
    --to=palves@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=philippe.waroquiers@skynet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).