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 words	magic number 405, 407, 410, 411, 430, 431
  13:  *				text size	)
  14:  *				data size	) in bytes but even
  15:  *				bss size	)
  16:  *				symbol table size
  17:  *				entry point
  18:  *				{unused}
  19:  *				flag set if no relocation
  20:  *	overlay header (if type 430, 431),
  21:  *		8 words long:	maximum overlay segement size	)
  22:  *				overlay 1 size			)
  23:  *				overlay 2 size			)
  24:  *				overlay 3 size			)
  25:  *				overlay 4 size			) size
  26:  *				overlay 5 size			) in
  27:  *				overlay 6 size			) even
  28:  *				overlay 7 size			) bytes
  29:  *
  30:  *	header:		0
  31:  *	text:		16 (32 if type 430,431)
  32:  *	overlays (if 430, 431 only):
  33:  *			32+textsize
  34:  *	overlaysize:	ov1+ov2+...+ov7
  35:  *	data:		16+textsize (+overlaysize+16 if type 431, 431)
  36:  *	relocation:	16+textsize+datasize (should not be present in 430,431)
  37:  *	symbol table:	16+2*(textsize+datasize) or 16+textsize+datasize
  38:  *	(if 430, 431):	32+(textsize+overlaysize+datasize)
  39:  *
  40:  */
  41: 
  42: 
  43: #include <whoami.h>
  44: #include <sys/param.h>
  45: #include <sys/dir.h>
  46: #include <sys/user.h>
  47: #include <sgtty.h>
  48: #include "mac.h"
  49: #include "mode.h"
  50: 
  51: 
  52: /*
  53:  * Internal variables ---
  54:  *  They are addressed by name. (e.g. (`0'-`9', `a'-`b'))
  55:  *  thus there can only be 36 of them.
  56:  */
  57: 
  58: #define VARB    11
  59: #define VARC    12  /* current overlay number */
  60: #define VARD    13
  61: #define VARE    14
  62: #define VARM    22
  63: #define VARO    24  /* overlay text segment addition */
  64: #define VARS    28
  65: #define VART    29
  66: 
  67: 
  68: #define RD  0
  69: #define WT  1
  70: #define NSP 0
  71: #define ISP 1
  72: #define DSP 2
  73: #define STAR    4
  74: #define STARCOM 0200
  75: #define DSYM    7
  76: #define ISYM    2
  77: #define ASYM    1
  78: #define NSYM    0
  79: #define ESYM    0177
  80: #define BKPTSET 1
  81: #define BKPTEXEC 2
  82: #define SYMSIZ  100
  83: #define MAXSIG  20
  84: 
  85: #define BPT 03
  86: #define FD  0200
  87: #define SETTRC  0
  88: #define RDUSER  2
  89: #define RIUSER  1
  90: #define WDUSER  5
  91: #define WIUSER  4
  92: #define RUREGS  3
  93: #define WUREGS  6
  94: #define CONTIN  7
  95: #define SINGLE  9
  96: #define EXIT    8
  97: 
  98: #ifndef NONFP
  99: #define FROFF   (&(0->u_fpsr))
 100: #define FRLEN   25
 101: #define FRMAX   6
 102: #endif
 103: 
 104: #include <sys/reg.h>
 105: #define NOREG   32767       /* impossible return from getreg() */
 106: #define NREG    9   /* 8 regs + PS from kernel stack */
 107: /*
 108:  * UAR0 is the value used for subprocesses when there is no core file.
 109:  * If it doesn't correspond to reality, use pstat -u on a core file to get uar0,
 110:  * subtract 0140000, and divide by 2 (sizeof int).
 111:  */
 112: #define UAR0    (&corhdr[509])  /* default address of r0 (u.u_ar0) */
 113: 
 114: #define KR0 2   /* location of r0 in kernel dump */
 115: #define KR1 3
 116: #define KR2 4
 117: #define KR3 5
 118: #define KR4 6
 119: #define KR5 7
 120: #define KSP 8
 121: #define KA6 9   /* saved ka6 in kernel dump */
 122: 
 123: #define MAXOFF  255
 124: #define MAXPOS  80
 125: #define MAXLIN  128
 126: #define EOF 0
 127: #define EOR '\n'
 128: #define TB  '\t'
 129: #define QUOTE   0200
 130: #define STRIP   0177
 131: #define LOBYTE  0377
 132: #define EVEN    -2
 133: 
 134: 
 135: /* long to ints and back (puns) */
 136: union {
 137:     INT I[2];
 138:     L_INT   L;
 139: } itolws;
 140: 
 141: #define leng(a)     ((long)((unsigned)(a)))
 142: #define shorten(a)  ((int)(a))
 143: #define itol(a,b)   (itolws.I[0]=(a), itolws.I[1]=(b), itolws.L)
 144: 
 145: 
 146: 
 147: /* result type declarations */
 148: L_INT       inkdot();
 149: SYMPTR      lookupsym();
 150: SYMPTR      symget();
 151: POS     get();
 152: POS     chkget();
 153: STRING      exform();
 154: L_INT       round();
 155: BKPTR       scanbkpt();
 156: VOID        fault();
 157: 
 158: typedef struct sgttyb TTY;
 159: TTY adbtty, usrtty;
 160: #include <setjmp.h>
 161: jmp_buf erradb;

Defined variables

adbtty defined in line 159; used 2 times
erradb defined in line 161; used 3 times
usrtty defined in line 159; used 4 times

Defined typedef's

TTY defined in line 158; used 1 times

Defined macros

ASYM defined in line 77; used 1 times
BKPTEXEC defined in line 81; used 2 times
BKPTSET defined in line 80; used 3 times
BPT defined in line 85; used 2 times
CONTIN defined in line 94; used 2 times
DSYM defined in line 75; used 6 times
EOF defined in line 126; never used
ESYM defined in line 79; used 2 times
EVEN defined in line 132; used 4 times
EXIT defined in line 96; used 1 times
FD defined in line 86; used 1 times
FRLEN defined in line 100; used 1 times
FRMAX defined in line 101; used 1 times
FROFF defined in line 99; used 2 times
KA6 defined in line 121; used 3 times
KR0 defined in line 114; used 1 times
KR1 defined in line 115; used 1 times
KR2 defined in line 116; used 1 times
KR3 defined in line 117; used 1 times
KR4 defined in line 118; used 1 times
KR5 defined in line 119; used 3 times
KSP defined in line 120; used 1 times
LOBYTE defined in line 131; never used
MAXLIN defined in line 125; used 1 times
MAXOFF defined in line 123; used 2 times
MAXPOS defined in line 124; used 2 times
MAXSIG defined in line 83; never used
NOREG defined in line 105; used 4 times
NREG defined in line 106; used 3 times
NSYM defined in line 78; used 4 times
QUOTE defined in line 129; used 2 times
RD defined in line 68; used 2 times
RDUSER defined in line 88; used 1 times
RIUSER defined in line 89; used 2 times
RUREGS defined in line 92; used 3 times
SETTRC defined in line 87; used 1 times
SINGLE defined in line 95; used 17 times
STAR defined in line 73; used 3 times
STARCOM defined in line 74; never used
STRIP defined in line 130; never used
SYMSIZ defined in line 82; used 1 times
TB defined in line 128; never used
UAR0 defined in line 112; used 1 times
VARB defined in line 58; used 1 times
VARD defined in line 60; used 1 times
VARE defined in line 61; used 1 times
VARM defined in line 62; used 1 times
VARO defined in line 63; used 1 times
VARS defined in line 64; used 1 times
VART defined in line 65; used 1 times
WDUSER defined in line 90; used 1 times
WIUSER defined in line 91; used 5 times
WT defined in line 69; used 2 times
WUREGS defined in line 93; used 2 times
itol defined in line 143; used 4 times

Usage of this include

Last modified: 1984-01-31
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1201
Valid CSS Valid XHTML 1.0 Strict