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]

[RFA/Ada] Implement Ada tasking support (take 2)


Following the discussions that happened on the first submissions,
here is a new version of the patch that hopefully addresses all
observations.  Just as a reference, here is the URL of the first
submission:

    http://www.sourceware.org/ml/gdb-patches/2008-09/msg00470.html

First, a big thank you to Eli and Tom who discussed the concepts and
looked at the patches. There were a couple of open questions:

  (1) The command names. The suggestion was to use an "ada" prefix to
      make it clearer that these are for Ada:

          (gdb) info ada tasks
          (gdb) ada task

      This would be breaking years of habit using "info tasks" and
      "tasks", but I don't personally mind, and it makes some kind
      of sense. I can always put some aliases in AdaCore's version.
      However, I think we ought to be consistent about this - I tried
      searching for other language-specific commands, and indeed,
      objc-lang defines "info selectors", "info classes", etc.
      I don't think that we should use that to argue that we should
      keep the old command names for Ada, particularly if we judge
      that this was a poor decision; just saying that we need to
      decide what our policy is.  Anyway, if the consensus is that
      they should be prefixed with "ada", no problem with me.

  (2) Discussion about the task-specific breakpoints. I just mentioned
      in passing this feature that is still yet to be contributed.
      I stil haven't really decided how this ought to be supported
      in the FSF tree - we have something in AdaCore's tree but it
      might not be the best way.

      Tom suggested a different syntax, which is based on using
      convenience functions in the condition field.

          break LINESPEC if $current_ada_task() == 5

      It's an interesting suggestion, and I'm not opposed. I'm just
      slightly concerned that the performance cost of evaluating
      a condition expression is higher than just a pure check
      directly coded in GDB.  It's also different from what is done
      for threads.

gdb/:
2008-09-24  Joel Brobecker  <brobecker@adacore.com>

        * target.h (struct target_ops): Add new field to_get_ada_task_ptid.
        (target_get_ada_task_ptid): New macro.
        * target.c (default_get_ada_task_ptid): New function.
        (update_current_target): Inherit field default_get_ada_task_ptid.
        (update_current_target): Make default_get_ada_task_ptid the default
        value for field to_get_ada_task_ptid.
        * ada-lang.h (struct task_control_block): Delete. Never used.
        (struct task_ptid, task_ptid_t, struct task_entry, task_list):
        Likewise.
        (struct ada_task_info): New.
        (ada_task_is_alive, ada_find_printable_frame)
        (ada_task_list_iterator_ftype, iterate_over_live_ada_tasks): Add
        declarations.
        (ada_build_task_list): Update prototype.
        (init_task_list, ada_is_exception_breakpoint): Remove prototypes.
        * ada-lang.c (ada_find_printable_frame): Make non-static.
        * ada-tasks.c: New file.
        * Makefile.in (SFILES): Add ada-tasks.c.
        (COMMON_OBS): Add ada-tasks.o.
        * linux-thread-db.c (thread_db_find_thread_from_tid)
        (thread_db_get_ada_task_ptid): New functions.
        (init_thread_db_ops): Set thread_db_ops.to_get_ada_task_ptid.

gdb/testsuite:
2008-09-24  Joel Brobecker  <brobecker@adacore.com>

        * gdb.base/completion.exp: Update expected output following
        the addition of the "info tasks" command.

gdb/doc:
2008-09-24  Joel Brobecker  <brobecker@adacore.com>

        * gdb.texinfo (Ada Tasks, Ada Tasks and Core Files): New nodes.
        (Patching): Replace incorrect usage of @samp by @kbd.

Tested on x86-linux.

-- 
Joel

Attachment: ada-tasks.diff
Description: Text document

Attachment: doc-ada-tasks.diff
Description: Text document


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