public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master:  * nto-procfs.c (do_attach): Form proper ptid including pid and tid.
@ 2008-10-23 21:29 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2008-10-23 21:29 UTC (permalink / raw)
  To: archer-commits

The branch, master has been updated
       via  c2aa1872dc5c22761af3e0f1864d3008ecdfb594 (commit)
       via  53b344a91b16a4bb610f6f4c72117fd9635330be (commit)
       via  4fcaedf9a7508b9fc9880a42115e0c793b8d2cbd (commit)
       via  1893b5e7e4693cb6444fdd8760447e778fe0e23a (commit)
       via  d6dad0c18b2c4a72ca335f1f5c8da705d1ebe71e (commit)
       via  9817dbd2c7667663f766c2e2c736fcda66d32883 (commit)
       via  36e71d77a05a2c5e3ed6adbda0b7b20ba75b386b (commit)
       via  2915ed56dbbf7d773aafc7412077d915341542d9 (commit)
       via  a095122b82efb8beab5b9bc1392e541704b469a0 (commit)
       via  554045041e9571e045aad464819606187df0f1b2 (commit)
       via  c50e438bb74a1ce9063960ea42d2733e48aa3515 (commit)
       via  e929fd1e13c666cf2af02597738e6337686a03f8 (commit)
       via  093731ed652a7eca552b23985ccaff06f516f12c (commit)
      from  bfd04c44d73948294ce4c341ee837769743a85ae (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit c2aa1872dc5c22761af3e0f1864d3008ecdfb594
Author: Aleksandar Ristovski <aristovski@qnx.com>
Date:   Thu Oct 23 20:15:50 2008 +0000

    	* nto-procfs.c (do_attach): Form proper ptid including pid and tid.
    	(procfs_create_inferior): Fetch list of threads.

commit 53b344a91b16a4bb610f6f4c72117fd9635330be
Author: Aleksandar Ristovski <aristovski@qnx.com>
Date:   Thu Oct 23 17:53:17 2008 +0000

    * nto-procfs.c (procfs_files_info): Fix a typo.
    (procfs_create_inferior): Make attach_flag per-inferior.

commit 4fcaedf9a7508b9fc9880a42115e0c793b8d2cbd
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Thu Oct 23 17:14:08 2008 +0000

    2008-10-23  Tom Tromey  <tromey@redhat.com>
    
    	* python/python-value.c (value_to_value_object): Initialize
    	owned_by_gdb field.
    	(valpy_new): Likewise.

commit 1893b5e7e4693cb6444fdd8760447e778fe0e23a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Oct 23 15:42:18 2008 +0000

    	* ada-tasks.c (task_states, long_task_states): Use constant N_()
    	initializer.  Define the strings as const.
    	(short_task_info, info_task): Translate the strings above.

commit d6dad0c18b2c4a72ca335f1f5c8da705d1ebe71e
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Thu Oct 23 00:00:05 2008 +0000

    daily update

commit 9817dbd2c7667663f766c2e2c736fcda66d32883
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Thu Oct 23 00:00:03 2008 +0000

    *** empty log message ***

commit 36e71d77a05a2c5e3ed6adbda0b7b20ba75b386b
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Oct 22 22:14:21 2008 +0000

            * NEWS: Add entry for new feature (Ada tasking support).

commit 2915ed56dbbf7d773aafc7412077d915341542d9
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Oct 22 20:22:01 2008 +0000

              * configure.ac: On alpha-osf, error out if enable_tui is set to
              "yes", and set enable_tui to "no" if previously set to "auto".
              Check for waddstr only if TUI support was requested. Move the
              part of the configure script that updates various Makefile
              variables up, together with the check for waddstr.
              * configure: Regenerate.

commit a095122b82efb8beab5b9bc1392e541704b469a0
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Oct 22 20:11:56 2008 +0000

            * gdbtypes.c (copy_type): New function.
            * gdbtypes.h (copy_type): Add declaration.
            * ada-lang.c (ada_to_fixed_type_1): If there is a parallel XVZ
            variable, then use it.

commit 554045041e9571e045aad464819606187df0f1b2
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Oct 22 19:48:31 2008 +0000

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

commit c50e438bb74a1ce9063960ea42d2733e48aa3515
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Oct 22 19:46:13 2008 +0000

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

commit e929fd1e13c666cf2af02597738e6337686a03f8
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Oct 22 19:45:05 2008 +0000

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

commit 093731ed652a7eca552b23985ccaff06f516f12c
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Oct 22 16:38:06 2008 +0000

    gdb
    	PR gdb/2506:
    	* c-exp.y (string_exp): New production.
    	(exp): Use it.
    gdb/testsuite
    	* gdb.base/exprs.exp (test_expr): Add test for string
    	concatenation.

-----------------------------------------------------------------------

Summary of changes:
 bfd/version.h                         |    2 +-
 gdb/ChangeLog                         |   74 +++
 gdb/Makefile.in                       |    3 +-
 gdb/NEWS                              |   14 +
 gdb/ada-lang.c                        |   42 ++-
 gdb/ada-lang.h                        |   69 +--
 gdb/ada-tasks.c                       |  991 +++++++++++++++++++++++++++++++++
 gdb/c-exp.y                           |   35 ++-
 gdb/configure                         |  165 ++++---
 gdb/configure.ac                      |   95 ++--
 gdb/doc/ChangeLog                     |    5 +
 gdb/doc/gdb.texinfo                   |  185 ++++++-
 gdb/gdbtypes.c                        |   22 +
 gdb/gdbtypes.h                        |    2 +
 gdb/linux-thread-db.c                 |   30 +
 gdb/nto-procfs.c                      |   10 +-
 gdb/python/python-value.c             |    2 +
 gdb/target.c                          |   16 +
 gdb/target.h                          |    9 +
 gdb/testsuite/ChangeLog               |   10 +
 gdb/testsuite/gdb.base/completion.exp |    6 +-
 gdb/testsuite/gdb.base/exprs.exp      |    4 +
 gdb/version.in                        |    2 +-
 23 files changed, 1638 insertions(+), 155 deletions(-)
 create mode 100644 gdb/ada-tasks.c

First 500 lines of diff:
diff --git a/bfd/version.h b/bfd/version.h
index 6b64d2d..f1e5e0f 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20081022
+#define BFD_VERSION_DATE 20081023
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cc6b0bb..8362188 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,77 @@
+2008-10-23  Aleksandar Ristovski  <aristovski@qnx.com>
+
+	* nto-procfs.c (do_attach): Form proper ptid including pid and tid.
+	(procfs_create_inferior): Fetch list of threads.
+
+2008-10-23  Aleksandar Ristovski  <aristovski@qnx.com>
+
+	* nto-procfs.c (procfs_files_info): Fix a typo.
+	(procfs_create_inferior): Make attach_flag per-inferior.
+
+2008-10-23  Tom Tromey  <tromey@redhat.com>
+
+	* python/python-value.c (value_to_value_object): Initialize
+	owned_by_gdb field.
+	(valpy_new): Likewise.
+	
+2008-10-23  Jan Kratochvil  <jan.kratochvil@redhat.com>
+	    Joel Brobecker  <brobecker@adacore.com>
+
+	* ada-tasks.c (task_states, long_task_states): Use constant N_()
+	initializer.  Define the strings as const.
+	(short_task_info, info_task): Translate the strings above.
+
+2008-10-22  Joel Brobecker  <brobecker@adacore.com>
+
+	* NEWS: Add entry for new feature (Ada tasking support).
+
+2008-10-22  Joel Brobecker  <brobecker@adacore.com>
+
+	* configure.ac: On alpha-osf, error out if enable_tui is set to
+	"yes", and set enable_tui to "no" if previously set to "auto".
+	Check for waddstr only if TUI support was requested. Move the
+	part of the configure script that updates various Makefile
+	variables up, together with the check for waddstr.
+	* configure: Regenerate.
+
+2008-10-22  Joel brobecker  <brobecker@adacore.com>
+
+	* gdbtypes.c (copy_type): New function.
+	* gdbtypes.h (copy_type): Add declaration.
+	* ada-lang.c (ada_to_fixed_type_1): If there is a parallel XVZ
+	variable, then use it.
+
+2008-10-22  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.
+
+2008-10-22  Tom Tromey  <tromey@redhat.com>
+
+	PR gdb/2506:
+	* c-exp.y (string_exp): New production.
+	(exp): Use it.
+
 2008-10-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* mips-tdep.c (mips_n32n64_fp_arg_chunk_p): Update TYPE_FIELD_STATIC
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index fe569c3..645d901 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -611,7 +611,7 @@ TARGET_FLAGS_TO_PASS = \
 # Links made at configuration time should not be specified here, since
 # SFILES is used in building the distribution archive.
 
-SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c  \
+SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
 	addrmap.c \
 	auxv.c ax-general.c ax-gdb.c \
 	bcache.c \
@@ -786,6 +786,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
 	dwarf2read.o mipsread.o stabsread.o corefile.o \
 	dwarf2expr.o dwarf2loc.o dwarf2-frame.o \
 	ada-lang.o c-lang.o f-lang.o objc-lang.o \
+	ada-tasks.o \
 	ui-out.o cli-out.o \
 	varobj.o vec.o wrapper.o \
 	jv-lang.o jv-valprint.o jv-typeprint.o \
diff --git a/gdb/NEWS b/gdb/NEWS
index 7c68728..6f8fb65 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -90,6 +90,20 @@ are treated as the standard definitions, regardless of context.
   GDB now has support for scripting using Python.  Whether this is
   available is determined at configure time.
 
+* Ada tasking support
+
+  Ada tasks can now be inspected in GDB. The following commands have
+  been introduced:
+
+    info tasks
+      Print the list of Ada tasks.
+    info task N
+      Print detailed information about task number N.
+    task
+      Print the task number of the current task.
+    task N
+      Switch the context of debugging to task number N.
+
 * New commands
 
 find [/size-char] [/max-count] start-address, end-address|+search-space-size,
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 2e29770..cce7da9 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7357,6 +7357,46 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr,
             if (real_type != NULL)
               return to_fixed_record_type (real_type, valaddr, address, NULL);
           }
+
+        /* Check to see if there is a parallel ___XVZ variable.
+           If there is, then it provides the actual size of our type.  */
+        else if (ada_type_name (fixed_record_type) != NULL)
+          {
+            char *name = ada_type_name (fixed_record_type);
+            char *xvz_name = alloca (strlen (name) + 7 /* "___XVZ\0" */);
+            int xvz_found = 0;
+            LONGEST size;
+
+            sprintf (xvz_name, "%s___XVZ", name);
+            size = get_int_var_value (xvz_name, &xvz_found);
+            if (xvz_found && TYPE_LENGTH (fixed_record_type) != size)
+              {
+                fixed_record_type = copy_type (fixed_record_type);
+                TYPE_LENGTH (fixed_record_type) = size;
+
+                /* The FIXED_RECORD_TYPE may have be a stub.  We have
+                   observed this when the debugging info is STABS, and
+                   apparently it is something that is hard to fix.
+
+                   In practice, we don't need the actual type definition
+                   at all, because the presence of the XVZ variable allows us
+                   to assume that there must be a XVS type as well, which we
+                   should be able to use later, when we need the actual type
+                   definition.
+
+                   In the meantime, pretend that the "fixed" type we are
+                   returning is NOT a stub, because this can cause trouble
+                   when using this type to create new types targeting it.
+                   Indeed, the associated creation routines often check
+                   whether the target type is a stub and will try to replace
+                   it, thus using a type with the wrong size. This, in turn,
+                   might cause the new type to have the wrong size too.
+                   Consider the case of an array, for instance, where the size
+                   of the array is computed from the number of elements in
+                   our array multiplied by the size of its element.  */
+                TYPE_STUB (fixed_record_type) = 0;
+              }
+          }
         return fixed_record_type;
       }
     case TYPE_CODE_ARRAY:
@@ -9888,7 +9928,7 @@ is_known_support_routine (struct frame_info *frame)
 /* Find the first frame that contains debugging information and that is not
    part of the Ada run-time, starting from FI and moving upward.  */
 
-static void
+void
 ada_find_printable_frame (struct frame_info *fi)
 {
   for (; fi != NULL; fi = get_prev_frame (fi))
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index 2d13603..ce6be4b 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -196,46 +196,37 @@ enum ada_renaming_category
 
 /* Ada task structures.  */
 
-/* Ada task control block, as defined in the GNAT runt-time library.  */
-
-struct task_control_block
+struct ada_task_info
 {
-  char state;
-  CORE_ADDR parent;
+  /* The PTID of the thread that this task runs on.  This ptid is computed
+     in a target-dependent way from the associated Task Control Block.  */
+  ptid_t ptid;
+
+  /* The ID of the task.  */
+  CORE_ADDR task_id;
+
+  /* The name of the task.  */
+  char name[257];
+
+  /* The current state of the task.  */
+  int state;
+
+  /* The priority associated to the task.  */
   int priority;
-  char image [32];
-  int image_len;    /* This field is not always present in the ATCB.  */
-  CORE_ADDR call;
-  CORE_ADDR thread;
-  CORE_ADDR lwp;    /* This field is not always present in the ATCB.  */
-
-  /* If the task is waiting on a task entry, this field contains the
-   task_id of the other task.  */
-  CORE_ADDR called_task;
-};
 
-struct task_ptid
-{
-  int pid;                      /* The Process id */
-  long lwp;                     /* The Light Weight Process id */
-  long tid;                     /* The Thread id */
-};
-typedef struct task_ptid task_ptid_t;
+  /* If non-zero, the task ID of the parent task.  */
+  CORE_ADDR parent;
 
-struct task_entry
-{
-  CORE_ADDR task_id;
-  struct task_control_block atcb;
-  int task_num;
-  int known_tasks_index;
-  struct task_entry *next_task;
-  task_ptid_t task_ptid;
-  int stack_per;
-};
+  /* If the task is waiting on a task entry, this field contains
+     the ID of the other task.  Zero otherwise.  */
+  CORE_ADDR called_task;
 
-/* task entry list.  */
-extern struct task_entry *task_list;
+  /* If the task is accepting a rendezvous with another task, this field
+     contains the ID of the calling task.  Zero otherwise.  */
+  CORE_ADDR caller_task;
+};
 
+int ada_task_is_alive (struct ada_task_info *task);
 
 /* Assuming V points to an array of S objects,  make sure that it contains at
    least M objects, updating V and S as necessary. */
@@ -465,6 +456,8 @@ extern enum ada_renaming_category ada_parse_renaming (struct symbol *,
 						      const char **,
 						      int *, const char **);
 
+extern void ada_find_printable_frame (struct frame_info *fi);
+
 extern char *ada_breakpoint_rewrite (char *, int *);
 
 extern char *ada_main_name (void);
@@ -473,9 +466,9 @@ extern char *ada_main_name (void);
 
 extern int valid_task_id (int);
 
-extern void init_task_list (void);
-
-extern int ada_is_exception_breakpoint (bpstat bs);
+typedef void (ada_task_list_iterator_ftype) (struct ada_task_info *task);
+extern void iterate_over_live_ada_tasks
+  (ada_task_list_iterator_ftype *iterator);
 
 extern void ada_adjust_exception_stop (bpstat bs);
 
@@ -491,7 +484,7 @@ extern void ada_print_exception_breakpoint_task (struct breakpoint *);
 
 extern void ada_reset_thread_registers (void);
 
-extern int ada_build_task_list (void);
+extern int ada_build_task_list (int warn_if_null);
 
 extern int ada_exception_catchpoint_p (struct breakpoint *b);
   
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
new file mode 100644
index 0000000..37e944b
--- /dev/null
+++ b/gdb/ada-tasks.c
@@ -0,0 +1,991 @@
+/* Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003, 2004,
+   2005, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "defs.h"
+#include "observer.h"
+#include "gdbcmd.h"
+#include "target.h"
+#include "ada-lang.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "gdbthread.h"
+
+/* The name of the array in the GNAT runtime where the Ada Task Control
+   Block of each task is stored.  */
+#define KNOWN_TASKS_NAME "system__tasking__debug__known_tasks"
+
+/* The maximum number of tasks known to the Ada runtime */
+static const int MAX_NUMBER_OF_KNOWN_TASKS = 1000;
+
+enum task_states
+{
+  Unactivated,
+  Runnable,
+  Terminated,
+  Activator_Sleep,
+  Acceptor_Sleep,
+  Entry_Caller_Sleep,
+  Async_Select_Sleep,
+  Delay_Sleep,
+  Master_Completion_Sleep,
+  Master_Phase_2_Sleep,
+  Interrupt_Server_Idle_Sleep,
+  Interrupt_Server_Blocked_Interrupt_Sleep,
+  Timer_Server_Sleep,
+  AST_Server_Sleep,
+  Asynchronous_Hold,
+  Interrupt_Server_Blocked_On_Event_Flag
+};
+
+/* A short description corresponding to each possible task state.  */
+static const char *task_states[] = {
+  N_("Unactivated"),
+  N_("Runnable"),
+  N_("Terminated"),
+  N_("Child Activation Wait"),
+  N_("Accept Statement"),
+  N_("Waiting on entry call"),
+  N_("Async Select Wait"),
+  N_("Delay Sleep"),
+  N_("Child Termination Wait"),
+  N_("Wait Child in Term Alt"),
+  "",
+  "",
+  "",
+  "",
+  N_("Asynchronous Hold"),
+  ""
+};
+
+/* A longer description corresponding to each possible task state.  */
+static const char *long_task_states[] = {
+  N_("Unactivated"),
+  N_("Runnable"),
+  N_("Terminated"),
+  N_("Waiting for child activation"),
+  N_("Blocked in accept statement"),
+  N_("Waiting on entry call"),
+  N_("Asynchronous Selective Wait"),
+  N_("Delay Sleep"),
+  N_("Waiting for children termination"),
+  N_("Waiting for children in terminate alternative"),
+  "",
+  "",
+  "",
+  "",
+  N_("Asynchronous Hold"),
+  ""
+};
+
+/* The index of certain important fields in the Ada Task Control Block
+   record and sub-records.  */
+
+struct tcb_fieldnos
+{
+  /* Fields in record Ada_Task_Control_Block.  */
+  int common;
+  int entry_calls;
+  int atc_nesting_level;
+
+  /* Fields in record Common_ATCB.  */
+  int state;
+  int parent;
+  int priority;
+  int image;
+  int image_len;     /* This field may be missing.  */
+  int call;
+  int ll;
+
+  /* Fields in Task_Primitives.Private_Data.  */
+  int ll_thread;
+  int ll_lwp;        /* This field may be missing.  */
+
+  /* Fields in Common_ATCB.Call.all.  */
+  int call_self;
+};
+
+/* The type description for the ATCB record and subrecords, and
+   the associated tcb_fieldnos. For efficiency reasons, these are made
+   static globals so that we can compute them only once the first time
+   and reuse them later.  Set to NULL if the types haven't been computed
+   yet, or if they may be obsolete (for instance after having loaded
+   a new binary).  */
+
+static struct type *atcb_type = NULL;
+static struct type *atcb_common_type = NULL;
+static struct type *atcb_ll_type = NULL;
+static struct type *atcb_call_type = NULL;
+static struct tcb_fieldnos fieldno;
+
+/* Set to 1 when the cached address of System.Tasking.Debug.Known_Tasks
+   might be stale and so needs to be recomputed.  */
+static int ada_tasks_check_symbol_table = 1;
+
+/* The list of Ada tasks.
+ 
+   Note: To each task we associate a number that the user can use to
+   reference it - this number is printed beside each task in the tasks
+   info listing displayed by "info tasks".  This number is equal to
+   its index in the vector + 1.  Reciprocally, to compute the index
+   of a task in the vector, we need to substract 1 from its number.  */
+typedef struct ada_task_info ada_task_info_s;
+DEF_VEC_O(ada_task_info_s);
+static VEC(ada_task_info_s) *task_list = NULL;
+
+/* When non-zero, this flag indicates that the current task_list
+   is obsolete, and should be recomputed before it is accessed.  */
+static int stale_task_list_p = 1;
+
+/* Return the task number of the task whose ptid is PTID, or zero
+   if the task could not be found.  */
+
+int
+ada_get_task_number (ptid_t ptid)
+{
+  int i;
+
+  for (i=0; i < VEC_length (ada_task_info_s, task_list); i++)
+    if (ptid_equal (VEC_index (ada_task_info_s, task_list, i)->ptid, ptid))
+      return i + 1;
+
+  return 0;  /* No matching task found.  */
+}
+
+/* Return the task number of the task that matches TASK_ID, or zero
+   if the task could not be found.  */
+ 
+static int
+get_task_number_from_id (CORE_ADDR task_id)
+{
+  int i;
+
+  for (i = 0; i < VEC_length (ada_task_info_s, task_list); i++)
+    {
+      struct ada_task_info *task_info =
+        VEC_index (ada_task_info_s, task_list, i);
+
+      if (task_info->task_id == task_id)
+        return i + 1;
+    }
+
+  /* Task not found.  Return 0.  */
+  return 0;
+}
+


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-23 21:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-23 21:29 [SCM] master: * nto-procfs.c (do_attach): Form proper ptid including pid and tid tromey

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