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