Now handles multiple hosts and targets.
[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 GDB 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 1, or (at your option)
9 any later version.
10
11 GDB 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 GDB; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 #define HOST_BYTE_ORDER LITTLE_ENDIAN
21
22 /* Get rid of any system-imposed stack limit if possible. */
23
24 #define SET_STACK_LIMIT_HUGE
25
26 /* This is the amount to subtract from u.u_ar0
27 to get the offset in the core file of the register values. */
28
29 #define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
30
31 #define REGISTER_U_ADDR(addr, blockend, regno) \
32 { addr = blockend - 0110 + regno * 4; \
33 if (regno == PC_REGNUM) addr = blockend - 8; \
34 if (regno == PS_REGNUM) addr = blockend - 4; \
35 if (regno == FP_REGNUM) addr = blockend - 0120; \
36 if (regno == AP_REGNUM) addr = blockend - 0124; \
37 if (regno == SP_REGNUM) addr = blockend - 20; }
38
39 /* Interface definitions for kernel debugger KDB. */
40
41 /* Map machine fault codes into signal numbers.
42 First subtract 0, divide by 4, then index in a table.
43 Faults for which the entry in this table is 0
44 are not handled by KDB; the program's own trap handler
45 gets to handle then. */
46
47 #define FAULT_CODE_ORIGIN 0
48 #define FAULT_CODE_UNITS 4
49 #define FAULT_TABLE \
50 { 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
51 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
52 0, 0, 0, 0, 0, 0, 0, 0}
53
54 /* Start running with a stack stretching from BEG to END.
55 BEG and END should be symbols meaningful to the assembler.
56 This is used only for kdb. */
57
58 #define INIT_STACK(beg, end) \
59 { asm (".globl end"); \
60 asm ("movl $ end, sp"); \
61 asm ("clrl fp"); }
62
63 /* Push the frame pointer register on the stack. */
64 #define PUSH_FRAME_PTR \
65 asm ("pushl fp");
66
67 /* Copy the top-of-stack to the frame pointer register. */
68 #define POP_FRAME_PTR \
69 asm ("movl (sp), fp");
70
71 /* After KDB is entered by a fault, push all registers
72 that GDB thinks about (all NUM_REGS of them),
73 so that they appear in order of ascending GDB register number.
74 The fault code will be on the stack beyond the last register. */
75
76 #define PUSH_REGISTERS \
77 { asm ("pushl 8(sp)"); \
78 asm ("pushl 8(sp)"); \
79 asm ("pushal 0x14(sp)"); \
80 asm ("pushr $037777"); }
81
82 /* Assuming the registers (including processor status) have been
83 pushed on the stack in order of ascending GDB register number,
84 restore them and return to the address in the saved PC register. */
85
86 #define POP_REGISTERS \
87 { asm ("popr $037777"); \
88 asm ("subl2 $8,(sp)"); \
89 asm ("movl (sp),sp"); \
90 asm ("rei"); }
This page took 0.045068 seconds and 4 git commands to generate.