home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / backup / star-1.3.1.tar.gz / star-1.3.1.tar / star-1.3.1 / lib / frame.h < prev    next >
C/C++ Source or Header  |  1996-06-16  |  2KB  |  53 lines

  1. /* @(#)frame.h    1.4 96/06/16 Copyright 1995 J. Schilling */
  2. /*
  3.  * Common definitions for routines that parse the stack frame.
  4.  *
  5.  * This file has to be fixed if you want to port routines which use getfp().
  6.  * Have a look at struct frame below and use it as a sample,
  7.  * the new struct frame must at least contain a member 'fr_savfp'.
  8.  */
  9. /* This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2, or (at your option)
  12.  * any later version.
  13.  *
  14.  * This program is distributed in the hope that it will be useful,
  15.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  * GNU General Public License for more details.
  18.  * 
  19.  * You should have received a copy of the GNU General Public License
  20.  * along with this program; see the file COPYING.  If not, write to
  21.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  22.  */
  23.  
  24. #if defined (sun) && (defined(SVR4) || defined(__SVR4) || defined(__SVR4__))
  25. #    ifdef    i386
  26.         /*
  27.          * On Solaris 2.1 x86 sys/frame.h is not useful at all
  28.          * On Solaris 2.4 x86 sys/frame.h is buggy (fr_savfp is int!!)
  29.          */
  30. #        include <sys/reg.h>
  31. #    endif
  32. #    include <sys/frame.h>
  33.  
  34. #elif    defined (sun)
  35. #    include <machine/frame.h>
  36. #else
  37.  
  38. /*
  39.  * XXX: I hope this will be useful on other machines (no guarantee)
  40.  * XXX: It is taken from a sun Motorola system, but should also be useful
  41.  * XXX: on a i386.
  42.  * XXX: In general you have to write a sample program, set a breakpoint
  43.  * XXX: on a small function and inspect the stackframe with adb.
  44.  */
  45.  
  46. struct frame {
  47.     struct frame    *fr_savfp;    /* saved frame pointer */
  48.     int        fr_savpc;    /* saved program counter */
  49.     int        fr_arg[1];    /* array of arguments */
  50. };
  51.  
  52. #endif
  53.