1 /* Parameters for execution on an HP 9000 model 320, for GDB, the GNU debugger.
2 Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20 /* HP/UX is USG, but it does have <ptrace.h> */
21 #include <sys/ptrace.h>
23 #define HOST_BYTE_ORDER BIG_ENDIAN
25 /* Define this to indicate problems with traps after continuing. */
28 /* fetch_inferior_registers is in hp300hpux-dep.c. */
29 #define FETCH_INFERIOR_REGISTERS
31 /* Set flag to indicate whether HP's assembler is in use. */
36 #else /* not GNU C. */
38 #endif /* not GNU C. */
40 /* Define this for versions of hp-ux older than 6.0 */
41 /* #define HPUX_VERSION_5 */
43 /* define USG if you are using sys5 /usr/include's */
44 #undef USG /* In case it was defined in the Makefile for cplus-dem.c */
47 /* The mem functions are in <string.h>. */
48 #undef MEM_FNS_DECLARED
49 #define MEM_FNS_DECLARED 1
53 /* Get rid of any system-imposed stack limit if possible. */
54 /* The hp9k320.h doesn't seem to have this feature. */
55 /* #define SET_STACK_LIMIT_HUGE */
56 /* So we'll just have to avoid big alloca's. */
57 #define BROKEN_LARGE_ALLOCA
59 /* This is the amount to subtract from u.u_ar0
60 to get the offset in the core file of the register values. */
63 #define KERNEL_U_ADDR 0x00979000
64 #else /* Not HPUX version 5. */
65 /* Use HPUX-style nlist() to get kernel_u_addr. */
66 #define KERNEL_U_ADDR_HPUX
67 #endif /* Not HPUX version 5. */
69 #define REGISTER_ADDR(u_ar0, regno) \
71 (((regno) < PS_REGNUM) \
72 ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \
73 : (((regno) == PS_REGNUM) \
74 ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \
75 : (&((struct exception_stack *) (u_ar0))->e_PC)))
77 #define FP_REGISTER_ADDR(u, regno) \
79 (((regno) < FPC_REGNUM) \
80 ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \
81 : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \
84 /* Do implement the attach and detach commands. */
88 /* Interface definitions for kernel debugger KDB. */
90 /* Map machine fault codes into signal numbers.
91 First subtract 0, divide by 4, then index in a table.
92 Faults for which the entry in this table is 0
93 are not handled by KDB; the program's own trap handler
94 gets to handle then. */
96 #define FAULT_CODE_ORIGIN 0
97 #define FAULT_CODE_UNITS 4
99 { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
100 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
101 0, 0, 0, 0, 0, 0, 0, 0, \
106 /* Start running with a stack stretching from BEG to END.
107 BEG and END should be symbols meaningful to the assembler.
108 This is used only for kdb. */
110 #define INIT_STACK(beg, end) \
111 { asm (".globl end"); \
112 asm ("movel $ end, sp"); \
115 /* Push the frame pointer register on the stack. */
116 #define PUSH_FRAME_PTR \
117 asm ("movel fp, -(sp)");
119 /* Copy the top-of-stack to the frame pointer register. */
120 #define POP_FRAME_PTR \
121 asm ("movl (sp), fp");
123 /* After KDB is entered by a fault, push all registers
124 that GDB thinks about (all NUM_REGS of them),
125 so that they appear in order of ascending GDB register number.
126 The fault code will be on the stack beyond the last register. */
128 #define PUSH_REGISTERS \
129 { asm ("clrw -(sp)"); \
130 asm ("pea 10(sp)"); \
131 asm ("movem $ 0xfffe,-(sp)"); }
133 /* Assuming the registers (including processor status) have been
134 pushed on the stack in order of ascending GDB register number,
135 restore them and return to the address in the saved PC register. */
137 #define POP_REGISTERS \
138 { asm ("subil $8,28(sp)"); \
139 asm ("movem (sp),$ 0xffff"); \
144 /* Start running with a stack stretching from BEG to END.
145 BEG and END should be symbols meaningful to the assembler.
146 This is used only for kdb. */
148 #define INIT_STACK(beg, end) \
149 { asm ("global end"); \
150 asm ("mov.l &end,%sp"); \
153 /* Push the frame pointer register on the stack. */
154 #define PUSH_FRAME_PTR \
155 asm ("mov.l %fp,-(%sp)");
157 /* Copy the top-of-stack to the frame pointer register. */
158 #define POP_FRAME_PTR \
159 asm ("mov.l (%sp),%fp");
161 /* After KDB is entered by a fault, push all registers
162 that GDB thinks about (all NUM_REGS of them),
163 so that they appear in order of ascending GDB register number.
164 The fault code will be on the stack beyond the last register. */
166 #define PUSH_REGISTERS \
167 { asm ("clr.w -(%sp)"); \
168 asm ("pea 10(%sp)"); \
169 asm ("movm.l &0xfffe,-(%sp)"); }
171 /* Assuming the registers (including processor status) have been
172 pushed on the stack in order of ascending GDB register number,
173 restore them and return to the address in the saved PC register. */
175 #define POP_REGISTERS \
176 { asm ("subi.l &8,28(%sp)"); \
177 asm ("mov.m (%sp),&0xffff"); \
180 #endif /* HPUX_ASM */
This page took 0.033761 seconds and 5 git commands to generate.