1 /* Definitions to make GDB hosted on a tahoe running 4.3-Reno
2 Copyright (C) 1986, 1987, 1989, 1991 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. */
21 * Ported by the State University of New York at Buffalo by the Distributed
22 * Computer Systems Lab, Department of Computer Science, 1991.
25 /* Get rid of any system-imposed stack limit if possible. */
27 #define SET_STACK_LIMIT_HUGE
29 #define REGISTER_U_ADDR(addr, blockend, regno) \
30 { addr = blockend - 100 + regno * 4; \
31 if (regno == PC_REGNUM) addr = blockend - 8; \
32 if (regno == PS_REGNUM) addr = blockend - 4; \
33 if (regno == FP_REGNUM) addr = blockend - 40; \
34 if (regno == SP_REGNUM) addr = blockend - 36; \
35 if (regno == AL_REGNUM) addr = blockend - 20; \
36 if (regno == AH_REGNUM) addr = blockend - 24;}
38 /* Interface definitions for kernel debugger KDB. */
40 /* Map machine fault codes into signal numbers.
41 First subtract 0, divide by 4, then index in a table.
42 Faults for which the entry in this table is 0
43 are not handled by KDB; the program's own trap handler
44 gets to handle then. */
46 #define FAULT_CODE_ORIGIN 0
47 #define FAULT_CODE_UNITS 4
49 { 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
50 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
51 0, 0, 0, 0, 0, 0, 0, 0}
53 /* Start running with a stack stretching from BEG to END.
54 BEG and END should be symbols meaningful to the assembler.
55 This is used only for kdb. */
57 #define INIT_STACK(beg, end) \
58 { asm (".globl end"); \
59 asm ("movl $ end, sp"); \
62 /* Push the frame pointer register on the stack. */
64 #define PUSH_FRAME_PTR \
67 /* Copy the top-of-stack to the frame pointer register. */
69 #define POP_FRAME_PTR \
70 asm ("movl (sp), fp");
72 /* After KDB is entered by a fault, push all registers
73 that GDB thinks about (all NUM_REGS of them),
74 so that they appear in order of ascending GDB register number.
75 The fault code will be on the stack beyond the last register. */
77 #define PUSH_REGISTERS \
78 { asm ("pushl 8(sp)"); \
79 asm ("pushl 8(sp)"); \
80 asm ("pushal 0x41(sp)"); \
98 asm ("pushl aclo" ); \
99 asm ("pushl achi" ); \
102 /* Assuming the registers (including processor status) have been
103 pushed on the stack in order of ascending GDB register number,
104 restore them and return to the address in the saved PC register. */
106 #define POP_REGISTERS \
108 asm ("movl (sp)+, achi"); \
109 asm ("movl (sp)+, aclo"); \
110 asm ("movl (sp)+, ps"); \
111 asm ("movl (sp)+, pc"); \
112 asm ("movl (sp)+, sp"); \
113 asm ("movl (sp)+, fp"); \
114 asm ("movl (sp)+, r12"); \
115 asm ("movl (sp)+, r11"); \
116 asm ("movl (sp)+, r10"); \
117 asm ("movl (sp)+, r9"); \
118 asm ("movl (sp)+, r8"); \
119 asm ("movl (sp)+, r7"); \
120 asm ("movl (sp)+, r6"); \
121 asm ("movl (sp)+, r5"); \
122 asm ("movl (sp)+, r4"); \
123 asm ("movl (sp)+, r3"); \
124 asm ("movl (sp)+, r2"); \
125 asm ("movl (sp)+, r1"); \
126 asm ("movl (sp)+, r0"); \
127 asm ("subl2 $8,(sp)"); \
128 asm ("movl (sp),sp"); \
This page took 0.031686 seconds and 4 git commands to generate.