* xm-vax.h: #ifndef ultrix around #include of endian.h and
[deliverable/binutils-gdb.git] / gdb / xm-vax.h
1 /* Definitions to make GDB run on a vax under 4.2bsd.
2 Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
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
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 #ifndef ultrix /* FIXME */
21 /* We have to include these files now, so that GDB will not make
22 competing definitions in defs.h. */
23 #include <machine/endian.h>
24 #include <machine/limits.h>
25 #endif /* ultrix */
26
27 #define HOST_BYTE_ORDER LITTLE_ENDIAN
28
29 /* Get rid of any system-imposed stack limit if possible. */
30
31 #define SET_STACK_LIMIT_HUGE
32
33 /* This is the amount to subtract from u.u_ar0
34 to get the offset in the core file of the register values. */
35
36 #define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
37
38 #define REGISTER_U_ADDR(addr, blockend, regno) \
39 { addr = blockend - 0110 + regno * 4; \
40 if (regno == PC_REGNUM) addr = blockend - 8; \
41 if (regno == PS_REGNUM) addr = blockend - 4; \
42 if (regno == FP_REGNUM) addr = blockend - 0120; \
43 if (regno == AP_REGNUM) addr = blockend - 0124; \
44 if (regno == SP_REGNUM) addr = blockend - 20; }
45
46 /* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */
47 #define ONE_PROCESS_WRITETEXT
48
49 /* Interface definitions for kernel debugger KDB. */
50
51 /* Map machine fault codes into signal numbers.
52 First subtract 0, divide by 4, then index in a table.
53 Faults for which the entry in this table is 0
54 are not handled by KDB; the program's own trap handler
55 gets to handle then. */
56
57 #define FAULT_CODE_ORIGIN 0
58 #define FAULT_CODE_UNITS 4
59 #define FAULT_TABLE \
60 { 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
61 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
62 0, 0, 0, 0, 0, 0, 0, 0}
63
64 /* Start running with a stack stretching from BEG to END.
65 BEG and END should be symbols meaningful to the assembler.
66 This is used only for kdb. */
67
68 #define INIT_STACK(beg, end) \
69 { asm (".globl end"); \
70 asm ("movl $ end, sp"); \
71 asm ("clrl fp"); }
72
73 /* Push the frame pointer register on the stack. */
74 #define PUSH_FRAME_PTR \
75 asm ("pushl fp");
76
77 /* Copy the top-of-stack to the frame pointer register. */
78 #define POP_FRAME_PTR \
79 asm ("movl (sp), fp");
80
81 /* After KDB is entered by a fault, push all registers
82 that GDB thinks about (all NUM_REGS of them),
83 so that they appear in order of ascending GDB register number.
84 The fault code will be on the stack beyond the last register. */
85
86 #define PUSH_REGISTERS \
87 { asm ("pushl 8(sp)"); \
88 asm ("pushl 8(sp)"); \
89 asm ("pushal 0x14(sp)"); \
90 asm ("pushr $037777"); }
91
92 /* Assuming the registers (including processor status) have been
93 pushed on the stack in order of ascending GDB register number,
94 restore them and return to the address in the saved PC register. */
95
96 #define POP_REGISTERS \
97 { asm ("popr $037777"); \
98 asm ("subl2 $8,(sp)"); \
99 asm ("movl (sp),sp"); \
100 asm ("rei"); }
This page took 0.039299 seconds and 5 git commands to generate.