2005-12-29 Paul Brook <paul@codesourcery.com>
[official-gcc.git] / gcc / ada / s-tasdeb.ads
blobd0c230d1f285e646c11be595dbccd212cb216352
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
4 -- --
5 -- S Y S T E M . T A S K I N G . D E B U G --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1997-2005, Free Software Foundation, Inc. --
10 -- --
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, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
21 -- --
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. --
28 -- --
29 -- GNARL was developed by the GNARL team at Florida State University. --
30 -- Extensive contributions were provided by Ada Core Technologies, Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 -- This package encapsulates all direct interfaces to task debugging services
35 -- that are needed by gdb with gnat mode.
37 with System.Tasking;
38 with System.OS_Interface;
40 package System.Tasking.Debug is
41 pragma Preelaborate;
43 ------------------------------------------
44 -- Application-level debugging routines --
45 ------------------------------------------
47 procedure List_Tasks;
48 -- Print a list of all the known Ada tasks with abbreviated state
49 -- information, one-per-line, to the standard error file.
51 procedure Print_Current_Task;
52 -- Write information about current task, in hexadecimal, as one line, to
53 -- the standard error file.
55 procedure Print_Task_Info (T : Task_Id);
56 -- Similar to Print_Current_Task, for a given task.
58 procedure Set_User_State (Value : Long_Integer);
59 -- Set user state value in the current task.
60 -- This state will be displayed when calling List_Tasks or
61 -- Print_Current_Task. It is useful for setting task specific state.
63 function Get_User_State return Long_Integer;
64 -- Return the user state for the current task.
66 -------------------------
67 -- General GDB support --
68 -------------------------
70 Known_Tasks : array (0 .. 999) of Task_Id := (others => null);
71 -- Global array of tasks read by gdb, and updated by
72 -- Create_Task and Finalize_TCB
74 ----------------------------------
75 -- VxWorks specific GDB support --
76 ----------------------------------
78 -- Although the following routines are implemented in a target independent
79 -- manner, only VxWorks currently uses them.
81 procedure Task_Creation_Hook (Thread : OS_Interface.Thread_Id);
82 -- This procedure is used to notify GDB of task's creation.
83 -- It must be called by the task's creator.
85 procedure Task_Termination_Hook;
86 -- This procedure is used to notify GDB of task's termination.
88 procedure Suspend_All_Tasks (Thread_Self : OS_Interface.Thread_Id);
89 -- Suspend all the tasks except the one whose associated thread is
90 -- Thread_Self by traversing All_Tasks_Lists and calling
91 -- System.Task_Primitives.Operations.Suspend_Task.
93 procedure Resume_All_Tasks (Thread_Self : OS_Interface.Thread_Id);
94 -- Resume all the tasks except the one whose associated thread is
95 -- Thread_Self by traversing All_Tasks_Lists and calling
96 -- System.Task_Primitives.Operations.Continue_Task.
98 -------------------------------
99 -- Run-time tracing routines --
100 -------------------------------
102 procedure Trace
103 (Self_Id : Task_Id;
104 Msg : String;
105 Flag : Character;
106 Other_Id : Task_Id := null);
107 -- If traces for Flag are enabled, display on Standard_Error a given
108 -- message for the current task. Other_Id is an optional second task id
109 -- to display.
111 procedure Set_Trace
112 (Flag : Character;
113 Value : Boolean := True);
114 -- Enable or disable tracing for Flag.
115 -- By default, flags in the range 'A' .. 'Z' are disabled, others are
116 -- enabled.
118 end System.Tasking.Debug;