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