re PR rtl-optimization/34522 (inefficient code for long long multiply when only low...
[official-gcc.git] / gcc / ada / s-tasdeb.ads
blob9aebe943d4d804c8e95e8d010276373062f54c1a
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-2007, 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. This state will be displayed
60 -- when calling List_Tasks or Print_Current_Task. It is useful for setting
61 -- 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 Create_Task and
72 -- 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. It must be
83 -- 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 procedure Stop_All_Tasks_Handler;
99 -- Stop all the tasks by traversing All_Tasks_Lists and calling
100 -- System.Task_Primitives.Operations.Stop_All_Task. This function
101 -- can be used in an interrupt handler.
103 procedure Stop_All_Tasks;
104 -- Stop all the tasks by traversing All_Tasks_Lists and calling
105 -- System.Task_Primitives.Operations.Stop_Task.
107 procedure Continue_All_Tasks;
108 -- Continue all the tasks by traversing All_Tasks_Lists and calling
109 -- System.Task_Primitives.Operations.Continue_Task.
111 -------------------------------
112 -- Run-time tracing routines --
113 -------------------------------
115 procedure Trace
116 (Self_Id : Task_Id;
117 Msg : String;
118 Flag : Character;
119 Other_Id : Task_Id := null);
120 -- If traces for Flag are enabled, display on Standard_Error a given
121 -- message for the current task. Other_Id is an optional second task id
122 -- to display.
124 procedure Set_Trace
125 (Flag : Character;
126 Value : Boolean := True);
127 -- Enable or disable tracing for Flag. By default, flags in the range
128 -- 'A' .. 'Z' are disabled, others are enabled.
130 end System.Tasking.Debug;