]>
Commit | Line | Data |
---|---|---|
5076de82 | 1 | /* Parameters for execution on a Sun, for GDB, the GNU debugger. |
a77bf669 | 2 | Copyright (C) 1986, 1987, 1989, 1996 Free Software Foundation, Inc. |
5076de82 FF |
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 | |
6c9638b4 | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
5076de82 FF |
19 | |
20 | #define HOST_BYTE_ORDER BIG_ENDIAN | |
21 | ||
22 | /* This is the amount to subtract from u.u_ar0 | |
23 | to get the offset in the core file of the register values. */ | |
24 | ||
25 | #define KERNEL_U_ADDR 0x2800 | |
26 | ||
5076de82 FF |
27 | \f |
28 | /* Interface definitions for kernel debugger KDB. */ | |
29 | ||
30 | /* Map machine fault codes into signal numbers. | |
31 | First subtract 0, divide by 4, then index in a table. | |
32 | Faults for which the entry in this table is 0 | |
33 | are not handled by KDB; the program's own trap handler | |
34 | gets to handle then. */ | |
35 | ||
36 | #define FAULT_CODE_ORIGIN 0 | |
37 | #define FAULT_CODE_UNITS 4 | |
38 | #define FAULT_TABLE \ | |
39 | { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ | |
40 | 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ | |
41 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
42 | SIGILL } | |
43 | ||
44 | /* Start running with a stack stretching from BEG to END. | |
45 | BEG and END should be symbols meaningful to the assembler. | |
46 | This is used only for kdb. */ | |
47 | ||
48 | #define INIT_STACK(beg, end) \ | |
49 | { asm (".globl end"); \ | |
50 | asm ("movel $ end, sp"); \ | |
51 | asm ("clrl fp"); } | |
52 | ||
53 | /* Push the frame pointer register on the stack. */ | |
54 | #define PUSH_FRAME_PTR \ | |
55 | asm ("movel fp, -(sp)"); | |
56 | ||
57 | /* Copy the top-of-stack to the frame pointer register. */ | |
58 | #define POP_FRAME_PTR \ | |
59 | asm ("movl (sp), fp"); | |
60 | ||
61 | /* After KDB is entered by a fault, push all registers | |
62 | that GDB thinks about (all NUM_REGS of them), | |
63 | so that they appear in order of ascending GDB register number. | |
64 | The fault code will be on the stack beyond the last register. */ | |
65 | ||
66 | #define PUSH_REGISTERS \ | |
67 | { asm ("clrw -(sp)"); \ | |
68 | asm ("pea 10(sp)"); \ | |
69 | asm ("movem $ 0xfffe,-(sp)"); } | |
70 | ||
71 | /* Assuming the registers (including processor status) have been | |
72 | pushed on the stack in order of ascending GDB register number, | |
73 | restore them and return to the address in the saved PC register. */ | |
74 | ||
75 | #define POP_REGISTERS \ | |
76 | { asm ("subil $8,28(sp)"); \ | |
77 | asm ("movem (sp),$ 0xffff"); \ | |
78 | asm ("rte"); } |