1 /* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
2 Copyright (C) 1987, 1989 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. */
20 #define HOST_BYTE_ORDER BIG_ENDIAN
22 #define HAVE_WAIT_STRUCT
24 /* Get rid of any system-imposed stack limit if possible. */
26 #define SET_STACK_LIMIT_HUGE
28 /* We can't use "isatty" or "fileno" on this machine. This isn't good,
29 but it will have to do. */
30 #define ISATTY(FP) ((FP) == stdin || (FP) == stdout)
32 /* THis is the amount to subtract from u.u_ar0
33 to get the offset in the core file of the register values. */
35 #define KERNEL_U_ADDR UADDR
37 /* The offsets in this macro are from /usr/include/machine/reg.h */
39 #define REGISTER_U_ADDR(addr, blockend, regno) \
40 { static char offsets[] = { \
41 /*d0-d7:*/1,2,3,4,5,6,7,8, \
42 /*a0-a6:*/9,10,11,12,13,14,15, /*sp:*/-4, /*ps:*/0, /*pc:*/-1, \
43 /*fp0-fp7:*/19,22,25,28,31,34,37,40, /*fpc:*/16,17,18 }; \
44 addr = blockend + 4 * offsets[regno]; \
47 /* Compensate for lack of `vprintf' function. */
48 #define MISSING_VPRINTF
50 /* NewsOS 3 apparently dies on large alloca's -- roland@ai.mit.edu. */
51 #define BROKEN_LARGE_ALLOCA
54 /* Interface definitions for kernel debugger KDB. */
56 /* Use GNU assembler instead of standard assembler */
59 /* Motorola assembly format */
64 /* Map machine fault codes into signal numbers.
65 First subtract 0, divide by 4, then index in a table.
66 Faults for which the entry in this table is 0
67 are not handled by KDB; the program's own trap handler
68 gets to handle then. */
70 #define FAULT_CODE_ORIGIN 0
71 #define FAULT_CODE_UNITS 4
73 { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
74 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
75 0, 0, 0, 0, 0, 0, 0, 0, \
78 /* Start running with a stack stretching from BEG to END.
79 BEG and END should be symbols meaningful to the assembler.
80 This is used only for kdb. */
83 #define INIT_STACK(beg, end) \
84 { asm (".globl end"); \
85 asm ("move.l $ end, sp"); \
88 #define INIT_STACK(beg, end) \
89 { asm (".globl end"); \
90 asm ("movel $ end, sp"); \
94 /* Push the frame pointer register on the stack. */
96 #define PUSH_FRAME_PTR \
97 asm ("move.l fp, -(sp)");
99 #define PUSH_FRAME_PTR \
100 asm ("movel fp, -(sp)");
103 /* Copy the top-of-stack to the frame pointer register. */
105 #define POP_FRAME_PTR \
106 asm ("move.l (sp), fp");
108 #define POP_FRAME_PTR \
109 asm ("movl (sp), fp");
112 /* After KDB is entered by a fault, push all registers
113 that GDB thinks about (all NUM_REGS of them),
114 so that they appear in order of ascending GDB register number.
115 The fault code will be on the stack beyond the last register. */
118 #define PUSH_REGISTERS \
119 { asm ("clr.w -(sp)"); \
120 asm ("pea (10,sp)"); \
121 asm ("movem $ 0xfffe,-(sp)"); }
123 #define PUSH_REGISTERS \
124 { asm ("clrw -(sp)"); \
125 asm ("pea 10(sp)"); \
126 asm ("movem $ 0xfffe,-(sp)"); }
129 /* Assuming the registers (including processor status) have been
130 pushed on the stack in order of ascending GDB register number,
131 restore them and return to the address in the saved PC register. */
134 #define POP_REGISTERS \
135 { asm ("subi.l $8,28(sp)"); \
136 asm ("movem (sp),$ 0xffff"); \
139 #define POP_REGISTERS \
140 { asm ("subil $8,28(sp)"); \
141 asm ("movem (sp),$ 0xffff"); \
This page took 0.032529 seconds and 4 git commands to generate.