File : s-tasdeb-raven.adb


   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 --                                  B o d y                                 --
   8 --                                                                          --
   9 --          Copyright (C) 2011-2014, Free Software Foundation, Inc.         --
  10 --                                                                          --
  11 -- GNAT 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 3,  or (at your option) any later ver- --
  14 -- sion.  GNAT 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.                                     --
  17 --                                                                          --
  18 --                                                                          --
  19 --                                                                          --
  20 --                                                                          --
  21 --                                                                          --
  22 -- You should have received a copy of the GNU General Public License and    --
  23 -- a copy of the GCC Runtime Library Exception along with this program;     --
  24 -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
  25 -- <http://www.gnu.org/licenses/>.                                          --
  26 --                                                                          --
  27 -- GNARL was developed by the GNARL team at Florida State University.       --
  28 -- Extensive contributions were provided by Ada Core Technologies, Inc.     --
  29 --                                                                          --
  30 ------------------------------------------------------------------------------
  31 
  32 --  This package encapsulates all direct interfaces to task debugging services
  33 --  that are needed by gdb with gnat mode.
  34 
  35 --  Note : This file *must* be compiled with debugging information
  36 
  37 --  Do not add any dependency on GNARL packages since this package is used in
  38 --  both normal and restricted (ravenscar) environments.
  39 
  40 package body System.Tasking.Debug is
  41 
  42    First_Task : Task_Id := null;
  43    pragma Unreferenced (First_Task);
  44    --  Head of known tasks list
  45 
  46    Last_Task  : Task_Id := null;
  47    --  Simply linked list of known tasks visible from GDB.  Tasks are always
  48    --  appended. The link is made with the Activation_Link component.
  49 
  50    -----------------
  51    -- Add_Task_Id --
  52    -----------------
  53 
  54    procedure Add_Task_Id (T : Task_Id) is
  55    begin
  56       pragma Assert (T.Common.Activation_Link = null);
  57 
  58       if Last_Task /= null then
  59          Last_Task.Common.Activation_Link := T;
  60       else
  61          First_Task := T;
  62       end if;
  63 
  64       Last_Task := T;
  65    end Add_Task_Id;
  66 
  67 end System.Tasking.Debug;