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