]>
Commit | Line | Data |
---|---|---|
dd3b648e RP |
1 | /* Definitions to make GDB run on a Pyramidax under OSx 4.0 (4.2bsd). |
2 | Copyright (C) 1988, 1989 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GDB. | |
5 | ||
99a7de40 | 6 | This program is free software; you can redistribute it and/or modify |
dd3b648e | 7 | it under the terms of the GNU General Public License as published by |
99a7de40 JG |
8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | |
dd3b648e | 10 | |
99a7de40 | 11 | This program is distributed in the hope that it will be useful, |
dd3b648e RP |
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 | |
99a7de40 JG |
17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
dd3b648e RP |
19 | |
20 | #define HOST_BYTE_ORDER BIG_ENDIAN | |
21 | ||
22 | /* Define PYRAMID_CONTROL_FRAME_DEBUGGING to get copious messages | |
23 | about reading the control stack on standard output. This | |
24 | makes gdb unusable as a debugger. */ | |
25 | ||
26 | /* #define PYRAMID_CONTROL_FRAME_DEBUGGING */ | |
27 | ||
28 | /* Define PYRAMID_FRAME_DEBUGGING for ? */ | |
29 | ||
30 | /* use Pyramid's slightly strange ptrace */ | |
31 | #define PYRAMID_PTRACE | |
32 | ||
33 | /* Traditional Unix virtual address spaces have thre regions: text, | |
34 | data and stack. The text, initialised data, and uninitialised data | |
35 | are represented in separate segments of the a.out file. | |
36 | When a process dumps core, the data and stack regions are written | |
37 | to a core file. This gives a debugger enough information to | |
38 | reconstruct (and debug) the virtual address space at the time of | |
39 | the coredump. | |
40 | Pyramids have an distinct fourth region of the virtual address | |
41 | space, in which the contents of the windowed registers are stacked | |
42 | in fixed-size frames. Pyramid refer to this region as the control | |
43 | stack. Each call (or trap) automatically allocates a new register | |
44 | frame; each return deallocates the current frame and restores the | |
45 | windowed registers to their values before the call. | |
46 | ||
47 | When dumping core, the control stack is written to a core files as | |
48 | a third segment. The core-handling functions need to know to deal | |
49 | with it. */ | |
50 | ||
51 | /* Tell dep.c what the extra segment is. */ | |
52 | #define PYRAMID_CORE | |
53 | ||
54 | #define NO_SIGINTERRUPT | |
55 | ||
56 | #define HAVE_WAIT_STRUCT | |
57 | ||
58 | /* Get rid of any system-imposed stack limit if possible. */ | |
59 | ||
60 | #define SET_STACK_LIMIT_HUGE | |
61 | ||
62 | /* This is the amount to subtract from u.u_ar0 | |
63 | to get the offset in the core file of the register values. */ | |
64 | ||
65 | #define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG)) | |
66 | ||
67 | /* Define offsets of registers in the core file (or maybe u area) */ | |
68 | #define REGISTER_U_ADDR(addr, blockend, regno) \ | |
69 | { struct user __u; \ | |
70 | addr = blockend + (regno - 16 ) * 4; \ | |
71 | if (regno == 67) { \ | |
72 | printf("\\geting reg 67\\"); \ | |
73 | addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \ | |
74 | } else if (regno == KSP_REGNUM) { \ | |
75 | printf("\\geting KSP (reg %d)\\", KSP_REGNUM); \ | |
76 | addr = (int)(&__u.u_pcb.pcb_ksp) - (int) &__u; \ | |
77 | } else if (regno == CSP_REGNUM) { \ | |
78 | printf("\\geting CSP (reg %d\\",CSP_REGNUM); \ | |
79 | addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \ | |
80 | } else if (regno == 64) { \ | |
81 | printf("\\geting reg 64\\"); \ | |
82 | addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \ | |
83 | } else if (regno == PS_REGNUM) \ | |
84 | addr = blockend - 4; \ | |
85 | else if (1 && ((16 > regno) && (regno > 11))) \ | |
86 | addr = last_frame_offset + (4 *(regno+32)); \ | |
87 | else if (0 && (12 > regno)) \ | |
88 | addr = global_reg_offset + (4 *regno); \ | |
89 | else if (16 > regno) \ | |
90 | addr = global_reg_offset + (4 *regno); \ | |
91 | else \ | |
92 | addr = blockend + (regno - 16 ) * 4; \ | |
93 | } | |
94 | ||
95 | /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ | |
96 | #define FETCH_INFERIOR_REGISTERS | |
97 | ||
98 | /* Compensate for lack of `vprintf' function. */ | |
99 | #define MISSING_VPRINTF | |
100 | ||
101 | \f | |
102 | /* Interface definitions for kernel debugger KDB. */ | |
103 | ||
104 | /* I have *no idea* how to debug OSx kernels, so this | |
105 | is flushed, possible forever. */ |