From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Cc: philippe.waroquiers@skynet.be
Subject: RFC: using Ada tasks numbers with thread commands
Date: Tue, 09 Oct 2018 14:09:00 -0000 [thread overview]
Message-ID: <20181009140902.GA3430@adacore.com> (raw)
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
next reply other threads:[~2018-10-09 14:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-09 14:09 Joel Brobecker [this message]
2018-10-09 14:22 ` Pedro Alves
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=20181009140902.GA3430@adacore.com \
--to=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