1 ------------------------------------------------------------------------------
3 -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
5 -- S Y S T E M . T R A C E S --
9 -- Copyright (C) 2001 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 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 with System.Soft_Links;
35 with System.Parameters;
36 with System.Traces.Format;
38 package body System.Traces is
40 package SSL renames System.Soft_Links;
41 use System.Traces.Format;
43 ----------------------
45 ----------------------
47 procedure Send_Trace_Info (Id : Trace_T) is
48 Task_S : String := SSL.Task_Name.all;
49 Trace_S : String (1 .. 3 + Task_S'Length);
52 if Parameters.Runtime_Traces then
53 Trace_S (1 .. 3) := "/N:";
54 Trace_S (4 .. Trace_S'Last) := Task_S;
55 Send_Trace (Id, Trace_S);
59 procedure Send_Trace_Info (Id : Trace_T; Timeout : Duration) is
60 Task_S : String := SSL.Task_Name.all;
61 Timeout_S : String := Duration'Image (Timeout);
62 Trace_S : String (1 .. 6 + Task_S'Length + Timeout_S'Length);
65 if Parameters.Runtime_Traces then
66 Trace_S (1 .. 3) := "/N:";
67 Trace_S (4 .. 3 + Task_S'Length) := Task_S;
68 Trace_S (4 + Task_S'Length .. 6 + Task_S'Length) := "/T:";
69 Trace_S (7 + Task_S'Length .. Trace_S'Last) := Timeout_S;
70 Send_Trace (Id, Trace_S);