This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: using Ada tasks numbers with thread commands


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]