File : s-tracon-ppc-eabi.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/EABI
  34 --  bareboard targets.
  35 
  36 package body System.Traceback_Control is
  37 
  38    ---------------------------
  39    --  Is_Topframe_Retaddr  --
  40    ---------------------------
  41 
  42    function Is_Topframe_Retaddr (Retaddr : System.Address) return Boolean is
  43    begin
  44       --  Call-chain entry points are marked with a null return address:
  45 
  46       return Retaddr = System.Null_Address;
  47    end Is_Topframe_Retaddr;
  48 
  49    -----------------------------
  50    --  Return_Address_Offset  --
  51    -----------------------------
  52 
  53    function Return_Address_Offset return System.Address is
  54 
  55       --  The return address slot is located right past the 4bytes back-chain
  56       --  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;