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