home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / GDB / GDB-4.13 / GDB-4 / gdb-4.13 / gdb / config / pa / tm-hppah.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-18  |  2.4 KB  |  70 lines

  1. /* Parameters for execution on an HP PA-RISC machine, running HPUX, for GDB.
  2.    Copyright 1991, 1992 Free Software Foundation, Inc. 
  3.  
  4.    Contributed by the Center for Software Science at the
  5.    University of Utah (pa-gdb-bugs@cs.utah.edu).
  6.  
  7. This file is part of GDB.
  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 of the License, or
  12. (at your option) 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; if not, write to the Free Software
  21. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  22.  
  23.  
  24. /* Actually, for a PA running HPUX the kernel calls the signal handler
  25.    without an intermediate trampoline.  Luckily the kernel always sets
  26.    the return pointer for the signal handler to point to _sigreturn.  */
  27. #define IN_SIGTRAMP(pc, name) (name && STREQ ("_sigreturn", name))
  28.  
  29. /* For HPUX:
  30.  
  31.    The signal context structure pointer is always saved at the base
  32.    of the frame which "calls" the signal handler.  We only want to find
  33.    the hardware save state structure, which lives 10 32bit words into
  34.    sigcontext structure.
  35.  
  36.    Within the hardware save state structure, registers are found in the
  37.    same order as the register numbers in GDB.
  38.  
  39.    The kernel apparently sets %r31 in the saved state structure to point
  40.    to the active instruction when the signal was taken.  Everything
  41.    else looks fairly reasonable.  (I assume the kernel fixes %r31 from
  42.    within _sigreturn?.  */
  43.  
  44. #define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \
  45. { \
  46.   *(TMP) = read_memory_integer ((FRAME)->frame + (41 * 4) , 4); \
  47. }
  48.  
  49. #define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
  50. { \
  51.   *(TMP) = read_memory_integer ((FRAME)->frame + (40 * 4), 4); \
  52. }
  53.  
  54. #define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \
  55. { \
  56.   int i; \
  57.   CORE_ADDR TMP; \
  58.   TMP = (FRAME)->frame + (10 * 4); \
  59.   for (i = 0; i < NUM_REGS; i++) \
  60.     { \
  61.       if (i == SP_REGNUM) \
  62.     (FSR)->regs[SP_REGNUM] = read_memory_integer (TMP + SP_REGNUM * 4, 4); \
  63.       else \
  64.     (FSR)->regs[i] = TMP + i * 4; \
  65.     } \
  66. }
  67.  
  68. /* Mostly it's common to all HPPA's.  */
  69. #include "pa/tm-hppa.h"
  70.