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