-- --
-- B o d y --
-- --
--- Copyright (C) 2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2009-2011, Free Software Foundation, Inc. --
-- --
--- GNARL is free software; you can redistribute it and/or modify it under --
+-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT 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 distributed with GNARL; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
+-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
+-- As a special exception under Section 7 of GPL version 3, you are granted --
+-- additional permissions described in the GCC Runtime Library Exception, --
+-- version 3.1, as published by the Free Software Foundation. --
+-- --
+-- You should have received a copy of the GNU General Public License and --
+-- a copy of the GCC Runtime Library Exception along with this program; --
+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
+-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
Res : out Stack_Usage_Result);
-- Convert an object of type System.Stack_Usage in a Stack_Usage_Result
- --------------
- -- Convert --
- --------------
+ -------------
+ -- Convert --
+ -------------
procedure Convert
(TS : System.Stack_Usage.Task_Result;
Res := TS;
end Convert;
- ----------------------
- -- Report_For_Task --
- ----------------------
+ ---------------------
+ -- Report_For_Task --
+ ---------------------
procedure Report_For_Task (Id : System.Tasking.Task_Id) is
begin
System.Stack_Usage.Report_Result (Id.Common.Analyzer);
end Report_For_Task;
- ------------------------
- -- Compute_All_Tasks --
- ------------------------
+ -----------------------
+ -- Compute_All_Tasks --
+ -----------------------
procedure Compute_All_Tasks is
Id : System.Tasking.Task_Id;
use type System.Tasking.Task_Id;
begin
if not System.Stack_Usage.Is_Enabled then
- Put ("Stack Usage not enabled: bind with -uNNN switch");
+ Put_Line ("Stack Usage not enabled: bind with -uNNN switch");
else
-- Loop over all tasks
end if;
end Compute_All_Tasks;
- ---------------------------
- -- Compute_Current_Task --
- ---------------------------
+ --------------------------
+ -- Compute_Current_Task --
+ --------------------------
procedure Compute_Current_Task is
begin
if not System.Stack_Usage.Is_Enabled then
- Put ("Stack Usage not enabled: bind with -uNNN switch");
+ Put_Line ("Stack Usage not enabled: bind with -uNNN switch");
else
-- The current task
end if;
end Compute_Current_Task;
- ------------------
- -- Report_Impl --
- ------------------
+ -----------------
+ -- Report_Impl --
+ -----------------
procedure Report_Impl (All_Tasks : Boolean; Do_Print : Boolean) is
begin
end Report_Impl;
- ----------------------
- -- Report_All_Task --
- ----------------------
+ ---------------------
+ -- Report_All_Task --
+ ---------------------
procedure Report_All_Tasks is
begin
Report_Impl (True, True);
end Report_All_Tasks;
- --------------------------
- -- Report_Current_Task --
- --------------------------
+ -------------------------
+ -- Report_Current_Task --
+ -------------------------
procedure Report_Current_Task is
Res : Stack_Usage_Result;
Print (Res);
end Report_Current_Task;
- --------------------------
- -- Get_All_Tasks_Usage --
- --------------------------
+ -------------------------
+ -- Get_All_Tasks_Usage --
+ -------------------------
function Get_All_Tasks_Usage return Stack_Usage_Result_Array is
Res : Stack_Usage_Result_Array
return Res;
end Get_All_Tasks_Usage;
- -----------------------------
- -- Get_Current_Task_Usage --
- -----------------------------
+ ----------------------------
+ -- Get_Current_Task_Usage --
+ ----------------------------
function Get_Current_Task_Usage return Stack_Usage_Result is
Res : Stack_Usage_Result;
return Res;
end Get_Current_Task_Usage;
- ------------
- -- Print --
- ------------
+ -----------
+ -- Print --
+ -----------
procedure Print (Obj : Stack_Usage_Result) is
- Pos : Positive;
- begin
+ Pos : Positive := Obj.Task_Name'Last;
+ begin
-- Simply trim the string containing the task name
for S in Obj.Task_Name'Range loop
end loop;
declare
- T_Name : constant String := Obj.Task_Name
- (Obj.Task_Name'First .. Pos);
+ T_Name : constant String :=
+ Obj.Task_Name (Obj.Task_Name'First .. Pos);
begin
Put_Line
- ("| " & T_Name & " | " & Natural'Image (Obj.Max_Size) &
- Natural'Image (Obj.Value) & " +/- " &
- Natural'Image (Obj.Variation));
+ ("| " & T_Name & " | " & Natural'Image (Obj.Stack_Size) &
+ Natural'Image (Obj.Value));
end;
end Print;