|
|
1.1 root 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: #define RD 0
54: #define WT 1
55: #define NSP 0
56: #define ISP 1
57: #define DSP 2
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 XSYM (-2)
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: #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: #define USP (ctob(UPAGES)-5*sizeof(int))
98: #define R0 (ctob(UPAGES)-19*sizeof(int))
99: #define R1 (ctob(UPAGES)-18*sizeof(int))
100: #define R2 (ctob(UPAGES)-17*sizeof(int))
101: #define R3 (ctob(UPAGES)-16*sizeof(int))
102: #define R4 (ctob(UPAGES)-15*sizeof(int))
103: #define R5 (ctob(UPAGES)-14*sizeof(int))
104: #define R6 (ctob(UPAGES)-13*sizeof(int))
105: #define R7 (ctob(UPAGES)-12*sizeof(int))
106: #define R8 (ctob(UPAGES)-11*sizeof(int))
107: #define R9 (ctob(UPAGES)-10*sizeof(int))
108: #define R10 (ctob(UPAGES)-9*sizeof(int))
109: #define R11 (ctob(UPAGES)-8*sizeof(int))
110: #define AP (ctob(UPAGES)-7*sizeof(int))
111: #define FP (ctob(UPAGES)-6*sizeof(int))
112: #define PC (ctob(UPAGES)-2*sizeof(int))
113: #define PSL (ctob(UPAGES)-1*sizeof(int))
114: #define P0BR 80
115: #define P0LR 84
116: #define P1BR 88
117: #define P1LR 92
118:
119: #define MAXOFF 255
120: #define MAXPOS 80
121: #define MAXLIN 128
122: #define EOF 0
123: #define EOR '\n'
124: #define SP ' '
125: #define TB '\t'
126: #define QUOTE 0200
127: #define STRIP 0177
128: #define LOBYTE 0377
129: #define EVEN -2
130:
131:
132: /* long to ints and back (puns) */
133: union {
134: INT I[2];
135: L_INT L;
136: } itolws;
137:
138: #ifndef vax
139: #define leng(a) ((long)((unsigned)(a)))
140: #define shorten(a) ((int)(a))
141: #define itol(a,b) (itolws.I[0]=(a), itolws.I[1]=(b), itolws.L)
142: #else
143: #define leng(a) itol(0,a)
144: #define shorten(a) ((short)(a))
145: #define itol(a,b) (itolws.I[0]=(b), itolws.I[1]=(a), itolws.L)
146: #endif
147:
148:
149:
150: /* result type declarations */
151: L_INT inkdot();
152: SYMPTR lookupsym();
153: SYMPTR symget();
154: POS get();
155: POS chkget();
156: STRING exform();
157: L_INT round();
158: BKPTR scanbkpt();
159: VOID fault();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.