Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/Ada] Implement Ada tasking support
Date: Tue, 23 Sep 2008 03:20:00 -0000	[thread overview]
Message-ID: <uwsh3o8g6.fsf@gnu.org> (raw)
In-Reply-To: <20080922233209.GE24389@adacore.com>

> Date: Mon, 22 Sep 2008 16:32:09 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> 
> Following our re-design of the ada-tasks module a while back to be
> submittable, I think it is now time to contribute this code.
> 
> Ada is one of these languages that includes tasking constructions
> built in to the language. While in C we use a thread library,
> in Ada, we use what is called "tasks". What this new module provides
> is support for examining these tasks:
> 
>   1. Getting the list of tasks and their current state
>   2. Switching from task to task
> 
> (1) is achieved by poking into an array in the GNAT Tasking runtime
>     named System.Tasking.Debug.Known_Tasks. We rely on the debugging
>     information to find how the Ada Task Control Block structure is
>     laid out, and get the pieces of info that we are looking at.
>     This part requires a little bit of code, particularly since
>     we try to accomodate maybe older versions of the GNAT runtime too.
>     But the code itself isn't very complicated. Just walking through
>     the type structures, and storing the information in a list of our
>     own.
> 
> (2) is a little more tricky - basically, what we need to do is relate
>     the information in each Ada Task Control Block (ATCB) back to
>     the associated thread. In practice, there are two fields, the
>     "thread" field, and the "LWP" field that we can use, whose content,
>     meaning and even availability depends on the target, and transform
>     that into the ptid of the corresponding thread. The good news is
>     that we know fairly well, for each target, what to use and how,
>     in order to get that ptid. So this strongly suggested a target
>     method.

I have a few general questions about this:

What is the differences, if any, between threads Ada tasks?

Would it make sense to make the existing threads commands to refer to
Ada tasks, instead of introducing a whole new bunch of commands?

Finally, if we do decide to have these new task commands, are there
any other languages which could, at least in principle, benefit from
the same feature for similar reasons, or is Ada the only one?

Thanks.


  reply	other threads:[~2008-09-23  3:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 23:33 Joel Brobecker
2008-09-23  3:20 ` Eli Zaretskii [this message]
2008-09-23 15:07   ` Joel Brobecker
2008-09-23 18:06     ` Eli Zaretskii
2008-09-23 18:30       ` Joel Brobecker
2008-09-23 19:17         ` Eli Zaretskii
2008-09-23 19:00     ` Tom Tromey
2008-09-23 18:24 ` Eli Zaretskii
2008-09-23 19:22 ` Tom Tromey

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=uwsh3o8g6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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