]>
Commit | Line | Data |
---|---|---|
c906108c SS |
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 | ||
c5aa993b JM |
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., 59 Temple Place - Suite 330, | |
22 | Boston, MA 02111-1307, USA. */ | |
c906108c SS |
23 | |
24 | #define HPUX_SNAP1 | |
25 | #define HPUX_SNAP2 | |
26 | ||
27 | #include "somsolib.h" | |
28 | ||
29 | /* Actually, for a PA running HPUX the kernel calls the signal handler | |
30 | without an intermediate trampoline. Luckily the kernel always sets | |
31 | the return pointer for the signal handler to point to _sigreturn. */ | |
32 | #define IN_SIGTRAMP(pc, name) (name && STREQ ("_sigreturn", name)) | |
33 | ||
34 | /* For HPUX: | |
35 | ||
36 | The signal context structure pointer is always saved at the base | |
37 | of the frame which "calls" the signal handler. We only want to find | |
38 | the hardware save state structure, which lives 10 32bit words into | |
39 | sigcontext structure. | |
40 | ||
41 | Within the hardware save state structure, registers are found in the | |
42 | same order as the register numbers in GDB. | |
43 | ||
44 | At one time we peeked at %r31 rather than the PC queues to determine | |
45 | what instruction took the fault. This was done on purpose, but I don't | |
46 | remember why. Looking at the PC queues is really the right way, and | |
47 | I don't remember why that didn't work when this code was originally | |
48 | written. */ | |
49 | ||
50 | #define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \ | |
51 | { \ | |
52 | *(TMP) = read_memory_integer ((FRAME)->frame + (43 * 4) , 4); \ | |
53 | } | |
54 | ||
55 | #define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \ | |
56 | { \ | |
57 | *(TMP) = read_memory_integer ((FRAME)->frame + (40 * 4), 4); \ | |
58 | } | |
59 | ||
60 | #define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \ | |
61 | { \ | |
62 | int i; \ | |
63 | CORE_ADDR TMP; \ | |
64 | TMP = (FRAME)->frame + (10 * 4); \ | |
65 | for (i = 0; i < NUM_REGS; i++) \ | |
66 | { \ | |
67 | if (i == SP_REGNUM) \ | |
68 | (FSR)->regs[SP_REGNUM] = read_memory_integer (TMP + SP_REGNUM * 4, 4); \ | |
69 | else \ | |
70 | (FSR)->regs[i] = TMP + i * 4; \ | |
71 | } \ | |
72 | } | |
73 | ||
74 | /* For HP-UX on PA-RISC we have an implementation | |
75 | for the exception handling target op (in hppa-tdep.c) */ | |
76 | #define CHILD_ENABLE_EXCEPTION_CALLBACK | |
77 | #define CHILD_GET_CURRENT_EXCEPTION_EVENT | |
78 | ||
79 | /* Mostly it's common to all HPPA's. */ | |
80 | #include "pa/tm-hppa.h" |