1 /* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
2 Copyright 1987, 1989, 1992 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 /* A News 1800 running NEWS-OS Release 4.0.1C is said to need this. */
23 /* Avoid "INT_MIN redefined" preprocessor warnings by defining them here. */
24 #include <sys/param.h>
26 #define HAVE_WAIT_STRUCT
28 /* Get rid of any system-imposed stack limit if possible. */
30 #define SET_STACK_LIMIT_HUGE
32 /* We can't use "isatty" or "fileno" on this machine. This isn't good,
33 but it will have to do. */
34 #define ISATTY(FP) ((FP) == stdin || (FP) == stdout)
36 /* THis is the amount to subtract from u.u_ar0
37 to get the offset in the core file of the register values. */
39 #define KERNEL_U_ADDR UADDR
41 /* The offsets in this macro are from /usr/include/machine/reg.h */
43 #define REGISTER_U_ADDR(addr, blockend, regno) \
44 { static char offsets[] = { \
45 /*d0-d7:*/1,2,3,4,5,6,7,8, \
46 /*a0-a6:*/9,10,11,12,13,14,15, /*sp:*/-4, /*ps:*/0, /*pc:*/-1, \
47 /*fp0-fp7:*/19,22,25,28,31,34,37,40, /*fpc:*/16,17,18 }; \
48 addr = blockend + 4 * offsets[regno]; \
52 #define BROKEN_LARGE_ALLOCA
54 /* NewsOS 3.3 does not define errno in <errno.h>. */
57 /* Interface definitions for kernel debugger KDB. */
59 /* Use GNU assembler instead of standard assembler */
62 /* Motorola assembly format */
67 /* Map machine fault codes into signal numbers.
68 First subtract 0, divide by 4, then index in a table.
69 Faults for which the entry in this table is 0
70 are not handled by KDB; the program's own trap handler
71 gets to handle then. */
73 #define FAULT_CODE_ORIGIN 0
74 #define FAULT_CODE_UNITS 4
76 { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
77 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
78 0, 0, 0, 0, 0, 0, 0, 0, \
81 /* Start running with a stack stretching from BEG to END.
82 BEG and END should be symbols meaningful to the assembler.
83 This is used only for kdb. */
86 #define INIT_STACK(beg, end) \
87 { asm (".globl end"); \
88 asm ("move.l $ end, sp"); \
91 #define INIT_STACK(beg, end) \
92 { asm (".globl end"); \
93 asm ("movel $ end, sp"); \
97 /* Push the frame pointer register on the stack. */
99 #define PUSH_FRAME_PTR \
100 asm ("move.l fp, -(sp)");
102 #define PUSH_FRAME_PTR \
103 asm ("movel fp, -(sp)");
106 /* Copy the top-of-stack to the frame pointer register. */
108 #define POP_FRAME_PTR \
109 asm ("move.l (sp), fp");
111 #define POP_FRAME_PTR \
112 asm ("movl (sp), fp");
115 /* After KDB is entered by a fault, push all registers
116 that GDB thinks about (all NUM_REGS of them),
117 so that they appear in order of ascending GDB register number.
118 The fault code will be on the stack beyond the last register. */
121 #define PUSH_REGISTERS \
122 { asm ("clr.w -(sp)"); \
123 asm ("pea (10,sp)"); \
124 asm ("movem $ 0xfffe,-(sp)"); }
126 #define PUSH_REGISTERS \
127 { asm ("clrw -(sp)"); \
128 asm ("pea 10(sp)"); \
129 asm ("movem $ 0xfffe,-(sp)"); }
132 /* Assuming the registers (including processor status) have been
133 pushed on the stack in order of ascending GDB register number,
134 restore them and return to the address in the saved PC register. */
137 #define POP_REGISTERS \
138 { asm ("subi.l $8,28(sp)"); \
139 asm ("movem (sp),$ 0xffff"); \
142 #define POP_REGISTERS \
143 { asm ("subil $8,28(sp)"); \
144 asm ("movem (sp),$ 0xffff"); \