home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnatlib / s-traceb.ads < prev    next >
Text File  |  2000-07-19  |  5KB  |  81 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                     S Y S T E M . T R A C E B A C K                      --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.1 $
  10. --                                                                          --
  11. --              Copyright (C) 1999 Ada Core Technologies, Inc.              --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
  22. -- MA 02111-1307, USA.                                                      --
  23. --                                                                          --
  24. -- As a special exception,  if other files  instantiate  generics from this --
  25. -- unit, or you link  this unit with other files  to produce an executable, --
  26. -- this  unit  does not  by itself cause  the resulting  executable  to  be --
  27. -- covered  by the  GNU  General  Public  License.  This exception does not --
  28. -- however invalidate  any other reasons why  the executable file  might be --
  29. -- covered by the  GNU Public License.                                      --
  30. --                                                                          --
  31. -- GNAT was originally developed  by the GNAT team at  New York University. --
  32. -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
  33. --                                                                          --
  34. ------------------------------------------------------------------------------
  35.  
  36. pragma Polling (Off);
  37. --  We must turn polling off for this unit, because otherwise we get
  38. --  elaboration circularities with System.Exception_Tables.
  39.  
  40. --  This package provides a method for generating a traceback of the
  41. --  current execution location. The traceback shows the locations of
  42. --  calls in the call chain, up to either the top or a designated
  43. --  number of levels.
  44.  
  45. package System.Traceback is
  46.  
  47.    subtype Code_Loc is System.Address;
  48.    --  Code location used for call addresses when computing tracebacks.
  49.    --  Values of this type are created by using Label'Address or
  50.    --  extracted from machine states using Get_Code_Loc.
  51.  
  52.    type Machine_State is new System.Address;
  53.    --  Similar to System.Machine_State_Operations.Machine_State, except that
  54.    --  the structure needed to get program counter tracebacks may be simpler if
  55.    --  the underlying implementation used is different.
  56.  
  57.    function Allocate_Machine_State return Machine_State;
  58.    --  Allocate the required space for a Machine_State
  59.  
  60.    procedure Free_Machine_State (M : in out Machine_State);
  61.    --  Free the dynamic memory taken by Machine_State
  62.  
  63.    function Get_Code_Loc (M : Machine_State) return Code_Loc;
  64.    --  This function extracts the program counter value from a machine
  65.    --  state, which the caller uses for recording entries in a traceback
  66.    --  table. The call returns a value of Null_Loc if the machine state
  67.    --  represents the outer level, or some other frame for which no information
  68.    --  can be provided.
  69.  
  70.    procedure Pop_Frame (M : Machine_State);
  71.    --  This procedure pops the machine state M so that it represents the
  72.    --  call point, as though the current subprogram had returned. It
  73.    --  changes only the value referenced by M, and does not affect
  74.    --  the current stack environment.
  75.  
  76.    procedure Set_Machine_State (M : Machine_State);
  77.    --  This routine sets M from the current machine state. It is called
  78.    --  to initiate a call chain computation.
  79.  
  80. end System.Traceback;
  81.