]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/config/pyr/xm-pyr.h
Initial creation of sourceware repository
[thirdparty/binutils-gdb.git] / gdb / config / pyr / xm-pyr.h
1 /* Definitions to make GDB run on a Pyramidax under OSx 4.0 (4.2bsd).
2 Copyright 1988, 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, Boston, MA 02111-1307, USA. */
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 /* This is the amount to subtract from u.u_ar0
59 to get the offset in the core file of the register values. */
60
61 #define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
62
63 /* Define offsets of registers in the core file (or maybe u area) */
64 #define REGISTER_U_ADDR(addr, blockend, regno) \
65 { struct user __u; \
66 addr = blockend + (regno - 16 ) * 4; \
67 if (regno == 67) { \
68 printf("\\geting reg 67\\"); \
69 addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \
70 } else if (regno == KSP_REGNUM) { \
71 printf("\\geting KSP (reg %d)\\", KSP_REGNUM); \
72 addr = (int)(&__u.u_pcb.pcb_ksp) - (int) &__u; \
73 } else if (regno == CSP_REGNUM) { \
74 printf("\\geting CSP (reg %d\\",CSP_REGNUM); \
75 addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \
76 } else if (regno == 64) { \
77 printf("\\geting reg 64\\"); \
78 addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \
79 } else if (regno == PS_REGNUM) \
80 addr = blockend - 4; \
81 else if (1 && ((16 > regno) && (regno > 11))) \
82 addr = last_frame_offset + (4 *(regno+32)); \
83 else if (0 && (12 > regno)) \
84 addr = global_reg_offset + (4 *regno); \
85 else if (16 > regno) \
86 addr = global_reg_offset + (4 *regno); \
87 else \
88 addr = blockend + (regno - 16 ) * 4; \
89 }
90
91 /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
92 #define FETCH_INFERIOR_REGISTERS