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