1 |
106 |
markom |
/* Common definitions to make GDB run on Vaxen under 4.2bsd and Ultrix.
|
2 |
|
|
Copyright (C) 1986, 1987, 1989, 1992 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., 59 Temple Place - Suite 330,
|
19 |
|
|
Boston, MA 02111-1307, USA. */
|
20 |
|
|
|
21 |
|
|
#define HOST_BYTE_ORDER LITTLE_ENDIAN
|
22 |
|
|
|
23 |
|
|
/* This is the amount to subtract from u.u_ar0
|
24 |
|
|
to get the offset in the core file of the register values. */
|
25 |
|
|
|
26 |
|
|
#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
|
27 |
|
|
|
28 |
|
|
/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */
|
29 |
|
|
#define ONE_PROCESS_WRITETEXT
|
30 |
|
|
|
31 |
|
|
/* Interface definitions for kernel debugger KDB. */
|
32 |
|
|
|
33 |
|
|
/* Map machine fault codes into signal numbers.
|
34 |
|
|
First subtract 0, divide by 4, then index in a table.
|
35 |
|
|
Faults for which the entry in this table is 0
|
36 |
|
|
are not handled by KDB; the program's own trap handler
|
37 |
|
|
gets to handle then. */
|
38 |
|
|
|
39 |
|
|
#define FAULT_CODE_ORIGIN 0
|
40 |
|
|
#define FAULT_CODE_UNITS 4
|
41 |
|
|
#define FAULT_TABLE \
|
42 |
|
|
{ 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
|
43 |
|
|
0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
|
44 |
|
|
0, 0, 0, 0, 0, 0, 0, 0}
|
45 |
|
|
|
46 |
|
|
/* Start running with a stack stretching from BEG to END.
|
47 |
|
|
BEG and END should be symbols meaningful to the assembler.
|
48 |
|
|
This is used only for kdb. */
|
49 |
|
|
|
50 |
|
|
#define INIT_STACK(beg, end) \
|
51 |
|
|
{ asm (".globl end"); \
|
52 |
|
|
asm ("movl $ end, sp"); \
|
53 |
|
|
asm ("clrl fp"); }
|
54 |
|
|
|
55 |
|
|
/* Push the frame pointer register on the stack. */
|
56 |
|
|
#define PUSH_FRAME_PTR \
|
57 |
|
|
asm ("pushl fp");
|
58 |
|
|
|
59 |
|
|
/* Copy the top-of-stack to the frame pointer register. */
|
60 |
|
|
#define POP_FRAME_PTR \
|
61 |
|
|
asm ("movl (sp), fp");
|
62 |
|
|
|
63 |
|
|
/* After KDB is entered by a fault, push all registers
|
64 |
|
|
that GDB thinks about (all NUM_REGS of them),
|
65 |
|
|
so that they appear in order of ascending GDB register number.
|
66 |
|
|
The fault code will be on the stack beyond the last register. */
|
67 |
|
|
|
68 |
|
|
#define PUSH_REGISTERS \
|
69 |
|
|
{ asm ("pushl 8(sp)"); \
|
70 |
|
|
asm ("pushl 8(sp)"); \
|
71 |
|
|
asm ("pushal 0x14(sp)"); \
|
72 |
|
|
asm ("pushr $037777"); }
|
73 |
|
|
|
74 |
|
|
/* Assuming the registers (including processor status) have been
|
75 |
|
|
pushed on the stack in order of ascending GDB register number,
|
76 |
|
|
restore them and return to the address in the saved PC register. */
|
77 |
|
|
|
78 |
|
|
#define POP_REGISTERS \
|
79 |
|
|
{ asm ("popr $037777"); \
|
80 |
|
|
asm ("subl2 $8,(sp)"); \
|
81 |
|
|
asm ("movl (sp),sp"); \
|
82 |
|
|
asm ("rei"); }
|