public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* RFC: using Ada tasks numbers with thread commands
@ 2018-10-09 14:09 Joel Brobecker
  2018-10-09 14:22 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Brobecker @ 2018-10-09 14:09 UTC (permalink / raw)
  To: gdb-patches; +Cc: philippe.waroquiers

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?

-- 
Joel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-09 14:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 14:09 RFC: using Ada tasks numbers with thread commands Joel Brobecker
2018-10-09 14:22 ` Pedro Alves

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).