Commit | Line | Data |
---|---|---|
2ee82f74 | 1 | /* "@(#)defs.h 4.3 %G%" */ |
3aa5c8bc BJ |
2 | # |
3 | /* | |
4 | * | |
5 | * UNIX debugger - common definitions | |
6 | * | |
7 | */ | |
8 | ||
9 | ||
10 | ||
11 | /* Layout of a.out file (fsym): | |
12 | * | |
13 | * header of 8 longwords | |
14 | * magic number 410 | |
15 | * text size ) | |
16 | * data size ) padded with 0 to multiple of 4 bytes | |
17 | * bss size ) | |
18 | * symbol table size | |
19 | * entry address | |
20 | * size of text relocation info | |
21 | * size of data relocation info | |
22 | * | |
23 | * | |
24 | * header: 0 | |
25 | * text: 32 | |
26 | * data: 32+textsize | |
27 | * text reloc: 32+textsize+datasize | |
28 | * data reloc: 32+textsize+datasize+textreloc | |
29 | * symbol table: 32+textsize+datasize+textreloc+datareloc | |
30 | * | |
31 | */ | |
32 | ||
33 | #include <sys/param.h> | |
34 | #include <sys/dir.h> | |
2ee82f74 | 35 | #include <machine/psl.h> |
3aa5c8bc BJ |
36 | #include <sys/user.h> |
37 | #include "mac.h" | |
38 | #include "mode.h" | |
39 | ||
40 | ||
41 | #define VARB 11 | |
42 | #define VARD 13 | |
43 | #define VARE 14 | |
44 | #define VARM 22 | |
45 | #define VARS 28 | |
46 | #define VART 29 | |
47 | ||
48 | #define COREMAGIC 0140000 | |
49 | ||
50 | /* access modes */ | |
51 | #define RD 0 | |
52 | #define WT 1 | |
53 | ||
54 | /* access spaces */ | |
55 | #define NSP 0 | |
56 | #define ISP 1 | |
57 | #define DSP 2 | |
58 | ||
59 | #define STAR 4 | |
60 | #define STARCOM 0200 | |
61 | #define DSYM 4 | |
62 | #define ISYM 4 | |
63 | #define ASYM 2 | |
64 | #define NSYM 0 | |
65 | #define ESYM (-1) | |
66 | #define BKPTSET 1 | |
67 | #define BKPTEXEC 2 | |
68 | #define SYMSIZ 100 | |
69 | #define MAXSIG 20 | |
70 | ||
71 | #define USERPS PSL | |
72 | #define USERPC PC | |
73 | #define BPT 03 | |
74 | #define TBIT 020 | |
75 | #define FD 0200 | |
76 | ||
77 | /* ptracew modes */ | |
78 | #define SETTRC 0 | |
79 | #define RDUSER 2 | |
80 | #define RIUSER 1 | |
81 | #define WDUSER 5 | |
82 | #define WIUSER 4 | |
83 | #define RUREGS 3 | |
84 | #define WUREGS 6 | |
85 | #define CONTIN 7 | |
86 | #define EXIT 8 | |
87 | #define SINGLE 9 | |
88 | ||
89 | #define FROFF (&(0->fpsr)) | |
90 | #define FRLEN 25 | |
91 | #define FRMAX 6 | |
92 | ||
93 | /* the quantities involving ctob() are located in the kernel stack. | |
94 | /* the others are in the pcb. | |
95 | */ | |
96 | #define KSP 0 | |
97 | #define ESP 4 | |
98 | #define SSP 8 | |
99 | #ifndef STD | |
100 | #define USP (ctob(UPAGES)-5*4) | |
101 | #define R0 (ctob(UPAGES)-18*4) | |
102 | #define R1 (ctob(UPAGES)-17*4) | |
103 | #define R2 (ctob(UPAGES)-16*4) | |
104 | #define R3 (ctob(UPAGES)-15*4) | |
105 | #define R4 (ctob(UPAGES)-14*4) | |
106 | #define R5 (ctob(UPAGES)-13*4) | |
107 | #define R6 (ctob(UPAGES)-12*4) | |
108 | #define R7 (ctob(UPAGES)-11*4) | |
109 | #define R8 (ctob(UPAGES)-10*4) | |
110 | #define R9 (ctob(UPAGES)-9*4) | |
111 | #define R10 (ctob(UPAGES)-8*4) | |
112 | #define R11 (ctob(UPAGES)-7*4) | |
113 | #define AP (ctob(UPAGES)-21*4) | |
114 | #define FP (ctob(UPAGES)-20*4) | |
115 | #define PC (ctob(UPAGES)-2*4) | |
116 | #define PSL (ctob(UPAGES)-1*4) | |
117 | #else | |
118 | #define USP (ctob(UPAGES)-5*4) | |
119 | #define R0 (ctob(UPAGES)-19*4) | |
120 | #define R1 (ctob(UPAGES)-18*4) | |
121 | #define R2 (ctob(UPAGES)-17*4) | |
122 | #define R3 (ctob(UPAGES)-16*4) | |
123 | #define R4 (ctob(UPAGES)-15*4) | |
124 | #define R5 (ctob(UPAGES)-14*4) | |
125 | #define R6 (ctob(UPAGES)-13*4) | |
126 | #define R7 (ctob(UPAGES)-12*4) | |
127 | #define R8 (ctob(UPAGES)-11*4) | |
128 | #define R9 (ctob(UPAGES)-10*4) | |
129 | #define R10 (ctob(UPAGES)-9*4) | |
130 | #define R11 (ctob(UPAGES)-8*4) | |
131 | #define AP (ctob(UPAGES)-7*4) | |
132 | #define FP (ctob(UPAGES)-6*4) | |
133 | #define PC (ctob(UPAGES)-2*4) | |
134 | #define PSL (ctob(UPAGES)-1*4) | |
135 | #endif | |
136 | #define P0BR 80 | |
137 | #define P0LR 84 | |
138 | #define P1BR 88 | |
139 | #define P1LR 92 | |
140 | ||
141 | #define MAXOFF 255 | |
142 | #define MAXPOS 80 | |
143 | #define MAXLIN 128 | |
144 | #define EOR '\n' | |
145 | #define SP ' ' | |
146 | #define TB '\t' | |
147 | #define QUOTE 0200 | |
148 | #define STRIP 0177 | |
149 | #define LOBYTE 0377 | |
150 | #define EVEN -2 | |
151 | ||
152 | ||
153 | #ifndef vax | |
154 | #define leng(a) ((long)((unsigned)(a))) | |
155 | #define shorten(a) ((int)(a)) | |
156 | #define itol(a,b) (itolws.I[0]=(a), itolws.I[1]=(b), itolws.L) | |
157 | #else | |
158 | #define leng(a) itol(0,a) | |
159 | #define shorten(a) ((short)(a)) | |
160 | #define itol(a,b) (itolws.I[0]=(b), itolws.I[1]=(a), itolws.L) | |
161 | #endif | |
162 | ||
163 | ||
164 | ||
165 | /* result type declarations */ | |
166 | L_INT inkdot(); | |
167 | SYMPTR lookupsym(); | |
168 | SYMPTR symget(); | |
169 | POS get(); | |
170 | POS chkget(); | |
171 | STRING exform(); | |
172 | L_INT round(); | |
173 | BKPTR scanbkpt(); | |
174 | VOID fault(); | |
175 | ||
176 | ||
177 | INT mkfault; | |
178 | INT executing; | |
179 | L_INT maxoff; | |
180 | L_INT maxpos; | |
181 | ADDR sigint; | |
182 | ADDR sigqit; | |
183 | INT wtflag; | |
184 | L_INT maxfile; | |
185 | L_INT maxstor; | |
186 | L_INT txtsiz; | |
187 | L_INT datsiz; | |
188 | L_INT datbas; | |
189 | L_INT stksiz; | |
190 | STRING errflg; | |
191 | INT magic; | |
192 | L_INT entrypt; | |
193 | ||
194 | CHAR lastc; | |
195 | ||
196 | STRING symfil; | |
197 | STRING corfil; | |
198 | MAP txtmap; | |
199 | MAP datmap; |