File : s-tracon-ppc-vxcert.adb


   1 ------------------------------------------------------------------------------
   2 --                                                                          --
   3 --                         GNAT COMPILER COMPONENTS                         --
   4 --                                                                          --
   5 --             S Y S T E M . T R A C E B A C K _ C O N T R O L              --
   6 --                                                                          --
   7 --                                 B o d y                                  --
   8 --                                                                          --
   9 --                                                                          --
  10 --             Copyright (C) 2012, Free Software Foundation, Inc.           --
  11 --                                                                          --
  12 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  13 -- terms of the  GNU General Public License as published  by the Free Soft- --
  14 -- ware  Foundation;  either version 3,  or (at your option) any later ver- --
  15 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  16 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  17 -- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
  18 --                                                                          --
  19 --                                                                          --
  20 --                                                                          --
  21 --                                                                          --
  22 --                                                                          --
  23 -- You should have received a copy of the GNU General Public License and    --
  24 -- a copy of the GCC Runtime Library Exception along with this program;     --
  25 -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
  26 -- <http://www.gnu.org/licenses/>.                                          --
  27 --                                                                          --
  28 -- GNAT was originally developed  by the GNAT team at  New York University. --
  29 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
  30 --                                                                          --
  31 ------------------------------------------------------------------------------
  32 
  33 --  This is the System.Traceback_Control implementation for PPC/VxWorks-Cert.
  34 
  35 package body System.Traceback_Control is
  36 
  37    ---------------------------
  38    --  Is_Topframe_Retaddr  --
  39    ---------------------------
  40 
  41    function Is_Topframe_Retaddr (Retaddr : System.Address) return Boolean is
  42 
  43       --  VxWorks-Cert marks call-chain entry points with a null return
  44       --  address.
  45 
  46    begin
  47       return Retaddr = System.Null_Address;
  48    end Is_Topframe_Retaddr;
  49 
  50    -----------------------------
  51    --  Return_Address_Offset  --
  52    -----------------------------
  53 
  54    function Return_Address_Offset return System.Address is
  55       --  VxWorks obeys the PowerPC EABI where the return address slot
  56       --  is located right past the 4bytes back-chain link in a frame:
  57       Return_Address_Slot_Offset : constant := 4;
  58 
  59    begin
  60       return Return_Address_Slot_Offset;
  61    end Return_Address_Offset;
  62 
  63 end System.Traceback_Control;