]>
Commit | Line | Data |
---|---|---|
dd3b648e RP |
1 | /* Definitions to make GDB run on an ISI Optimum V (3.05) under 4.3bsd. |
2 | Copyright (C) 1987, 1989 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GDB. | |
5 | ||
99a7de40 | 6 | This program is free software; you can redistribute it and/or modify |
dd3b648e | 7 | it under the terms of the GNU General Public License as published by |
99a7de40 JG |
8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | |
dd3b648e | 10 | |
99a7de40 | 11 | This program is distributed in the hope that it will be useful, |
dd3b648e RP |
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. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
99a7de40 JG |
17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
dd3b648e RP |
19 | |
20 | #define HOST_BYTE_ORDER BIG_ENDIAN | |
21 | ||
22 | /* This has not been tested on ISI's running BSD 4.2, but it will probably | |
23 | work. */ | |
24 | ||
25 | /* This is the amount to subtract from u.u_ar0 | |
26 | to get the offset in the core file of the register values. */ | |
27 | ||
28 | /*#define KERNEL_U_ADDR 0x10800000*/ | |
29 | #define KERNEL_U_ADDR 0 | |
30 | ||
31 | /* expects blockend to be u.u_ar0 */ | |
32 | extern int rloc[]; /* Defined in isi-dep.c */ | |
33 | #define REGISTER_U_ADDR(addr, blockend, regno) \ | |
34 | { blockend &= UPAGES*NBPG - 1; \ | |
35 | if (regno < 18) addr = (int)blockend + rloc[regno]*4; \ | |
36 | else if (regno < 26) addr = (int) &((struct user *)0)->u_68881_regs \ | |
37 | + (regno - 18) * 12; \ | |
38 | else if (regno < 29) addr = (int) &((struct user *)0)->u_68881_regs \ | |
39 | + 8 * 12 + (regno - 26) * 4; \ | |
40 | } | |
41 | ||
42 | /* Compensate for lack of `vprintf' function. */ | |
43 | #define MISSING_VPRINTF | |
44 | \f | |
45 | /* Interface definitions for kernel debugger KDB. */ | |
46 | ||
47 | /* Map machine fault codes into signal numbers. | |
48 | First subtract 0, divide by 4, then index in a table. | |
49 | Faults for which the entry in this table is 0 | |
50 | are not handled by KDB; the program's own trap handler | |
51 | gets to handle then. */ | |
52 | ||
53 | #define FAULT_CODE_ORIGIN 0 | |
54 | #define FAULT_CODE_UNITS 4 | |
55 | #define FAULT_TABLE \ | |
56 | { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ | |
57 | 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ | |
58 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
59 | SIGILL } | |
60 | ||
61 | /* Start running with a stack stretching from BEG to END. | |
62 | BEG and END should be symbols meaningful to the assembler. | |
63 | This is used only for kdb. */ | |
64 | ||
65 | #define INIT_STACK(beg, end) \ | |
66 | { asm (".globl end"); \ | |
67 | asm ("movl $ end, sp"); \ | |
68 | asm ("clrl fp"); } | |
69 | ||
70 | /* Push the frame pointer register on the stack. */ | |
71 | #define PUSH_FRAME_PTR \ | |
72 | asm ("movel fp, -(sp)"); | |
73 | ||
74 | /* Copy the top-of-stack to the frame pointer register. */ | |
75 | #define POP_FRAME_PTR \ | |
76 | asm ("movl (sp), fp"); | |
77 | ||
78 | /* After KDB is entered by a fault, push all registers | |
79 | that GDB thinks about (all NUM_REGS of them), | |
80 | so that they appear in order of ascending GDB register number. | |
81 | The fault code will be on the stack beyond the last register. */ | |
82 | ||
83 | #define PUSH_REGISTERS \ | |
84 | { asm ("clrw -(sp)"); \ | |
85 | asm ("pea 10(sp)"); \ | |
86 | asm ("movem $ 0xfffe,-(sp)"); } | |
87 | ||
88 | /* Assuming the registers (including processor status) have been | |
89 | pushed on the stack in order of ascending GDB register number, | |
90 | restore them and return to the address in the saved PC register. */ | |
91 | ||
92 | #define POP_REGISTERS \ | |
93 | { asm ("subil $8,28(sp)"); \ | |
94 | asm ("movem (sp),$ 0xffff"); \ | |
95 | asm ("rte"); } |