1 ------------------------------------------------------------------------------
3 -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
5 -- S Y S T E M . T A S K I N G . D E B U G --
9 -- Copyright (C) 1997-2004, Free Software Foundation, Inc. --
11 -- GNARL is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNARL; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNARL was developed by the GNARL team at Florida State University. --
30 -- Extensive contributions were provided by Ada Core Technologies, Inc. --
32 ------------------------------------------------------------------------------
34 -- This package encapsulates all direct interfaces to task debugging services
35 -- that are needed by gdb with gnat mode.
38 with System
.OS_Interface
;
40 package System
.Tasking
.Debug
is
42 ------------------------------------------
43 -- Application-level debugging routines --
44 ------------------------------------------
47 -- Print a list of all the known Ada tasks with abbreviated state
48 -- information, one-per-line, to the standard error file.
50 procedure Print_Current_Task
;
51 -- Write information about current task, in hexadecimal, as one line, to
52 -- the standard error file.
54 procedure Print_Task_Info
(T
: Task_Id
);
55 -- Similar to Print_Current_Task, for a given task.
57 procedure Set_User_State
(Value
: Long_Integer);
58 -- Set user state value in the current task.
59 -- This state will be displayed when calling List_Tasks or
60 -- Print_Current_Task. It is useful for setting task specific state.
62 function Get_User_State
return Long_Integer;
63 -- Return the user state for the current task.
65 -------------------------
66 -- General GDB support --
67 -------------------------
69 Known_Tasks
: array (0 .. 999) of Task_Id
;
70 -- Global array of tasks read by gdb, and updated by
71 -- Create_Task and Finalize_TCB
73 ----------------------------------
74 -- VxWorks specific GDB support --
75 ----------------------------------
77 -- Although the following routines are implemented in a target independent
78 -- manner, only VxWorks currently uses them.
80 procedure Task_Creation_Hook
(Thread
: OS_Interface
.Thread_Id
);
81 -- This procedure is used to notify GDB of task's creation.
82 -- It must be called by the task's creator.
84 procedure Task_Termination_Hook
;
85 -- This procedure is used to notify GDB of task's termination.
87 procedure Suspend_All_Tasks
(Thread_Self
: OS_Interface
.Thread_Id
);
88 -- Suspend all the tasks except the one whose associated thread is
89 -- Thread_Self by traversing All_Tasks_Lists and calling
90 -- System.Task_Primitives.Operations.Suspend_Task.
92 procedure Resume_All_Tasks
(Thread_Self
: OS_Interface
.Thread_Id
);
93 -- Resume all the tasks except the one whose associated thread is
94 -- Thread_Self by traversing All_Tasks_Lists and calling
95 -- System.Task_Primitives.Operations.Continue_Task.
97 -------------------------------
98 -- Run-time tracing routines --
99 -------------------------------
105 Other_Id
: Task_Id
:= null);
106 -- If traces for Flag are enabled, display on Standard_Error a given
107 -- message for the current task. Other_Id is an optional second task id
112 Value
: Boolean := True);
113 -- Enable or disable tracing for Flag.
114 -- By default, flags in the range 'A' .. 'Z' are disabled, others are
117 end System
.Tasking
.Debug
;