# 2.11BSD#431 - /usr/src/bin/adb/defs.h

##### Variables

    adbtty            X
    erradb            X
    usrtty            X

##### Macros

    ANDF              X
    ASYM              X
    BEGIN             X
    BKPTEXEC          X
    BKPTSET           X
    BPT               X
    DO                X
    DONE              X
    DSP               X
    DSYM              X
    ELIF              X
    ELSE              X
    END               X
    EOR               X
    ESYM              X
    EVEN              X
    FALSE             X
    FI                X
    FOR               X
    HIBYTE            X
    IF                X
    ISP               X
    ISYM              X
    KA6               X
    KR0               X
    KR1               X
    KR2               X
    KR3               X
    KR4               X
    KR5               X
    KSP               X
    LINSIZ            X
    LOBYTE            X
    LOOP              X
    LPRMODE           X
    MAXARG            X
    MAXCOM            X
    MAXLIN            X
    MAXOFF            X
    MAXPOS            X
    MAXSYMLEN         X
    NOREG             X
    NREG              X
    NSP               X
    NSYM              X
    OD                X
    OFFMODE           X
    ORF               X
    PER               X
    POOL              X
    QUOTE             X
    RD                X
    REP               X
    SP                X
    STAR              X
    STRIP             X
    SYMTYPE           X
    TB                X
    THEN              X
    TRUE              X
    UAR0              X
    VARB              X
    VARC              X
    VARD              X
    VARE              X
    VARM              X
    VARO              X
    VARS              X
    VART              X
    WHILE             X
    WT                X
    itol              X
    leng              X
    shorten           X

##### struct's

    SYMbol            X
    bkpt              X
    map               X
    reglist           X

##### typedef's

    BKPT              X
    BKPTR             X
    MAP               X
    MAPPTR            X
    MSG               X
    REGLIST           X
    REGPTR            X
    U                 X

       1: /*
       2:  *
       3:  *      UNIX debugger - common definitions
       4:  *
       5:  *	1998/4/21 - remove local redefinitions used with ptrace
       6:  *
       7:  *      Layout of a.out file (fsym):
       8:  *
       9:  *	This has changed over time - see a.out.h, sys/exec.h and nlist.h
      10:  *	for the current a.out definition and format.
      11:  */
      12:
      13: #include <sys/param.h>
      14: #include <sys/user.h>
      15: #include <machine/reg.h>
      16: #include <sgtty.h>
      17: #include <setjmp.h>
      18: #include <unistd.h>
      19: #include <a.out.h>
      20: #include <sys/ptrace.h>
      21:
      22: #define MAXSYMLEN   32
      23: #define MAXCOM  64
      24: #define MAXARG  32
      25: #define LINSIZ  512
      26:
      27: #define BEGIN   {
      28: #define END }
      29:
      30: #define IF  if(
      31: #define THEN    ){
      32: #define ELSE    } else {
      33: #define ELIF    } else if (
      34: #define FI  }
      35:
      36: #define FOR for(
      37: #define WHILE   while(
      38: #define DO  ){
      39: #define OD  }
      40: #define REP do{
      41: #define PER }while(
      42: #define DONE    );
      43: #define LOOP    for(;;){
      44: #define POOL    }
      45:
      46: #define ANDF    &&
      47: #define ORF ||
      48:
      49: #define LPRMODE "%Q"
      50: #define OFFMODE "+%o"
      51:
      52: /*
      53:  * This is the memory resident portion of a symbol.  The only difference
      54:  * between this and a 'nlist' entry is the size of the string offset   By
      55:  * restricting the string table to be less than 64kb we save 2 bytes per
      56:  * symbol - approximately 7.5kb of D space in the case of /unix's symbol
      57:  * table.  In practice this restriction is unlikely to be reached since
      58:  * even the kernel's symbol table of ~28kb only has a strings table of 21kb.
      59: */
      60:
      61:     struct  SYMbol
      62:         {
      63:         u_short value;
      64:         char    type;
      65:         char    ovno;
      66:         u_short soff;       /* low order of string table offset */
      67:         };
      68:
      69: #define SYMTYPE(symflag) (( symflag>=041 || (symflag>=02 && symflag<=04))\
      70:                 ?  ((symflag&07)>=3 ? DSYM : (symflag&07))\
      71:                 : NSYM)
      72:
      73: typedef char        MSG[];
      74: typedef struct map  MAP;
      75: typedef MAP     *MAPPTR;
      76: typedef struct bkpt BKPT;
      77: typedef BKPT        *BKPTR;
      78: typedef struct user U;
      79:
      80: /* file address maps */
      81: struct map {
      82:     long    b1;
      83:     long    e1;
      84:     long    f1;
      85:     long    bo;
      86:     long    eo;
      87:     long    fo;
      88:     long    b2;
      89:     long    e2;
      90:     long    f2;
      91:     int ufd;
      92: };
      93:
      94: struct bkpt {
      95:     int loc;
      96:     int ins;
      97:     int count;
      98:     int initcnt;
      99:     char    flag;
     100:     char    ovly;
     101:     char    comm[MAXCOM];
     102:     BKPT    *nxtbkpt;
     103: };
     104:
     105: typedef struct reglist  REGLIST;
     106: typedef REGLIST     *REGPTR;
     107: struct reglist {
     108:     char    *rname;
     109:     int roffs;
     110: };
     111:
     112: /*
     113:  * Internal variables ---
     114:  *  They are addressed by name. (e.g. (`0'-`9', `a'-`b'))
     115:  *  thus there can only be 36 of them.
     116:  */
     117:
     118: #define VARB    11
     119: #define VARC    12      /* current overlay number */
     120: #define VARD    13
     121: #define VARE    14
     122: #define VARM    22
     123: #define VARO    24      /* overlay text segment addition */
     124: #define VARS    28
     125: #define VART    29
     126:
     127: #define RD      0
     128: #define WT      1
     129: #define NSP     0
     130: #define ISP     1
     131: #define DSP     2
     132: #define STAR    4
     133: #define DSYM    7
     134: #define ISYM    2
     135: #define ASYM    1
     136: #define NSYM    0
     137: #define ESYM    0177
     138: #define BKPTSET 1
     139: #define BKPTEXEC 2
     140:
     141: #define BPT     03
     142:
     143: #define NOREG   32767           /* impossible return from getreg() */
     144: #define NREG    9       /* 8 regs + PS from kernel stack */
     145: /*
     146:  * UAR0 is the value used for subprocesses when there is no core file.
     147:  * If it doesn't correspond to reality, use pstat -u on a core file to
     148:  * get uar0, subtract 0140000, and divide by 2 (sizeof int).
     149:  */
     150: #define UAR0    (&corhdr[ctob(USIZE)/sizeof(u_int) - 3]) /* default address of r0 (u.u_ar0) */
     151:
     152: #define KR0     (0300/2)       /* location of r0 in kernel dump */
     153: #define KR1     (KR0+1)
     154: #define KR2     (KR0+2)
     155: #define KR3     (KR0+3)
     156: #define KR4     (KR0+4)
     157: #define KR5     (KR0+5)
     158: #define KSP     (KR0+6)
     159: #define KA6     (KR0+7)       /* saved ka6 in kernel dump */
     160:
     161: #define MAXOFF  255
     162: #define MAXPOS  80
     163: #define MAXLIN  128
     164:
     165: #define TRUE     (-1)
     166: #define FALSE   0
     167: #define LOBYTE  0377
     168: #define HIBYTE  0177400
     169: #define STRIP   0177
     170:
     171: #define SP  ' '
     172: #define TB  '\t'
     173: #define EOR     '\n'
     174: #define QUOTE   0200
     175: #define EVEN    (~1)
     176:
     177: /* long to ints and back (puns) */
     178: union {
     179:     int     I[2];
     180:     long   L;
     181: } itolws;
     182:
     183: #define leng(a)         ((long)((unsigned)(a)))
     184: #define shorten(a)      ((int)(a))
     185: #define itol(a,b)       (itolws.I[0]=(a), itolws.I[1]=(b), itolws.L)
     186:
     187: /* result type declarations */
     188: long    inkdot();
     189: struct  SYMbol  *lookupsym();
     190: struct  SYMbol  *symget();
     191: u_int   get(), chkget();
     192: char    *exform();
     193: char    *cache_sym(), *no_cache_sym();
     194: long    round();
     195: BKPTR           scanbkpt();
     196:
     197: struct sgttyb adbtty, usrtty;
     198: jmp_buf erradb;

#### Defined variables

adbtty defined in line 197; used 2 times

- in /usr/src/bin/adb/main.c line 85
- in /usr/src/bin/adb/runpcs.c line 240

erradb defined in line 198; used 3 times

- in /usr/src/bin/adb/main.c line 59, 122, 143

usrtty defined in line 197; used 4 times

- in /usr/src/bin/adb/main.c line 86
- in /usr/src/bin/adb/runpcs.c line 55, 118, 239

#### Defined struct's

SYMbol defined in line 61; used 48 times

- in line 189-190(4)
- in /usr/src/bin/adb/expr.c line 12(2), 118(2), 244-248(4)
- in /usr/src/bin/adb/findfn.c line 6(2)
- in /usr/src/bin/adb/format.c line 7(2)
- in /usr/src/bin/adb/print.c line 13(2), 76(2)
- in /usr/src/bin/adb/sym.c line 6(2), 22(2), 31(2), 98-99(4), 138(2), 159(2), 186(4), 202(4), 244(2), 284(2), 308(2)

bkpt defined in line 94; used 1 times

- in line 76

map defined in line 81; used 1 times

- in line 74

reglist defined in line 107; used 1 times

- in line 105

#### Defined typedef's

BKPT defined in line 76; used 2 times

- in line 77, 102

BKPTR defined in line 77; used 18 times

- in line 195
- in /usr/src/bin/adb/access.c line 48
- in /usr/src/bin/adb/pcs.c line 10, 30, 62(2)
- in /usr/src/bin/adb/print.c line 24, 71
- in /usr/src/bin/adb/runpcs.c line 10, 41, 78, 110, 161-163(2), 176, 186, 207, 216

MAP defined in line 74; used 13 times

- in line 75
- in /usr/src/bin/adb/access.c line 6-7(2)
- in /usr/src/bin/adb/command.c line 7-8(2)
- in /usr/src/bin/adb/opset.c line 11
- in /usr/src/bin/adb/pcs.c line 15
- in /usr/src/bin/adb/print.c line 9-10(2), 316
- in /usr/src/bin/adb/setup.c line 4-5(2)
- in /usr/src/bin/adb/sym.c line 11

MAPPTR defined in line 75; used 3 times

- in /usr/src/bin/adb/access.c line 93, 140
- in /usr/src/bin/adb/command.c line 99

MSG defined in line 73; used 61 times

- in /usr/src/bin/adb/access.c line 3-5(3)
- in /usr/src/bin/adb/command.c line 3-6(4)
- in /usr/src/bin/adb/expr.c line 4-10(7)
- in /usr/src/bin/adb/findfn.c line 3
- in /usr/src/bin/adb/format.c line 4-6(3)
- in /usr/src/bin/adb/main.c line 3
- in /usr/src/bin/adb/message.c line 3-30(28)
- in /usr/src/bin/adb/output.c line 10
- in /usr/src/bin/adb/pcs.c line 3-7(5)
- in /usr/src/bin/adb/print.c line 4-8(5)
- in /usr/src/bin/adb/runpcs.c line 4-6(3)

REGLIST defined in line 105; used 4 times

- in line 106
- in /usr/src/bin/adb/print.c line 42, 54
- in /usr/src/bin/adb/runpcs.c line 11

REGPTR defined in line 106; used 2 times

- in /usr/src/bin/adb/print.c line 361, 386

U defined in line 78; used 13 times

- in /usr/src/bin/adb/command.c line 181
- in /usr/src/bin/adb/print.c line 349, 376, 399
- in /usr/src/bin/adb/runpcs.c line 47, 199, 282, 292
- in /usr/src/bin/adb/setup.c line 110-112(3), 183, 189

#### Defined macros

ANDF defined in line 46; never used
ASYM defined in line 135; used 1 times

- in /usr/src/bin/adb/command.c line 79

BEGIN defined in line 27; never used
BKPTEXEC defined in line 139; used 2 times

- in /usr/src/bin/adb/runpcs.c line 63-64(2)

BKPTSET defined in line 138; used 3 times

- in /usr/src/bin/adb/pcs.c line 70
- in /usr/src/bin/adb/runpcs.c line 84, 122

BPT defined in line 141; used 2 times

- in /usr/src/bin/adb/runpcs.c line 121, 224

DO defined in line 38; never used
DONE defined in line 42; never used
DSP defined in line 131; used 25 times

- in /usr/src/bin/adb/access.c line 55, 70, 82-85(2), 95-96(2), 122, 131
- in /usr/src/bin/adb/command.c line 75, 103
- in /usr/src/bin/adb/expr.c line 87, 139
- in /usr/src/bin/adb/findfn.c line 29-32(2)
- in /usr/src/bin/adb/print.c line 194, 202-206(2), 225, 232, 248, 258(3), 275, 283

DSYM defined in line 133; used 7 times

- in line 70
- in /usr/src/bin/adb/command.c line 75, 89
- in /usr/src/bin/adb/opset.c line 308, 399
- in /usr/src/bin/adb/print.c line 367-372(2)

ELIF defined in line 33; never used
ELSE defined in line 32; never used
END defined in line 28; never used
EOR defined in line 173; used 26 times

- in /usr/src/bin/adb/command.c line 50, 152
- in /usr/src/bin/adb/format.c line 179, 233
- in /usr/src/bin/adb/input.c line 7, 15, 33, 66
- in /usr/src/bin/adb/main.c line 133, 149
- in /usr/src/bin/adb/output.c line 22, 36, 53
- in /usr/src/bin/adb/pcs.c line 76
- in /usr/src/bin/adb/print.c line 85, 103-106(2), 284, 332, 368-373(2), 409
- in /usr/src/bin/adb/runpcs.c line 100, 133, 140, 156

ESYM defined in line 137; never used
EVEN defined in line 175; used 4 times

- in /usr/src/bin/adb/expr.c line 127, 139
- in /usr/src/bin/adb/print.c line 191, 232

FALSE defined in line 166; used 12 times

- in /usr/src/bin/adb/command.c line 51, 63, 93, 202
- in /usr/src/bin/adb/expr.c line 121, 321
- in /usr/src/bin/adb/findfn.c line 20(2)
- in /usr/src/bin/adb/input.c line 65
- in /usr/src/bin/adb/main.c line 124
- in /usr/src/bin/adb/print.c line 147
- in /usr/src/bin/adb/sym.c line 73

FI defined in line 34; never used
FOR defined in line 36; never used
HIBYTE defined in line 168; never used
IF defined in line 30; never used
ISP defined in line 130; used 14 times

- in /usr/src/bin/adb/access.c line 96, 108
- in /usr/src/bin/adb/command.c line 83
- in /usr/src/bin/adb/expr.c line 90
- in /usr/src/bin/adb/findfn.c line 32-33(2), 51-54(2)
- in /usr/src/bin/adb/print.c line 265-266(2), 272-273(2), 408(2)

ISYM defined in line 134; used 15 times

- in /usr/src/bin/adb/command.c line 83, 89, 163
- in /usr/src/bin/adb/expr.c line 253
- in /usr/src/bin/adb/findfn.c line 44
- in /usr/src/bin/adb/opset.c line 321, 334, 380
- in /usr/src/bin/adb/print.c line 218, 272, 301, 372, 408
- in /usr/src/bin/adb/runpcs.c line 227
- in /usr/src/bin/adb/sym.c line 103

KA6 defined in line 159; used 3 times

- in /usr/src/bin/adb/setup.c line 128, 146, 159

KR0 defined in line 152; used 8 times

- in line 153-159(7)
- in /usr/src/bin/adb/print.c line 61

KR1 defined in line 153; used 1 times

- in /usr/src/bin/adb/print.c line 60

KR2 defined in line 154; used 1 times

- in /usr/src/bin/adb/print.c line 59

KR3 defined in line 155; used 1 times

- in /usr/src/bin/adb/print.c line 58

KR4 defined in line 156; used 1 times

- in /usr/src/bin/adb/print.c line 57

KR5 defined in line 157; used 3 times

- in /usr/src/bin/adb/expr.c line 127
- in /usr/src/bin/adb/print.c line 56, 191

KSP defined in line 158; used 1 times

- in /usr/src/bin/adb/print.c line 55

LINSIZ defined in line 25; used 2 times

- in /usr/src/bin/adb/input.c line 4
- in /usr/src/bin/adb/runpcs.c line 128

LOBYTE defined in line 167; used 38 times

- in /usr/src/bin/adb/access.c line 67
- in /usr/src/bin/adb/format.c line 135-145(4)
- in /usr/src/bin/adb/opset.c line 76-90(15), 98-111(14), 126-127(2)
- in /usr/src/bin/adb/print.c line 276(2)

LOOP defined in line 43; never used
LPRMODE defined in line 49; used 1 times

- in /usr/src/bin/adb/sym.c line 85

MAXARG defined in line 24; used 1 times

- in /usr/src/bin/adb/runpcs.c line 127

MAXCOM defined in line 23; used 2 times

- in line 101
- in /usr/src/bin/adb/pcs.c line 74

MAXLIN defined in line 163; used 2 times

- in /usr/src/bin/adb/output.c line 7, 45

MAXOFF defined in line 161; used 2 times

- in /usr/src/bin/adb/main.c line 104
- in /usr/src/bin/adb/print.c line 157

MAXPOS defined in line 162; used 2 times

- in /usr/src/bin/adb/main.c line 104
- in /usr/src/bin/adb/print.c line 153

MAXSYMLEN defined in line 22; used 4 times

- in /usr/src/bin/adb/expr.c line 24, 236
- in /usr/src/bin/adb/sym.c line 336, 342

NOREG defined in line 143; used 4 times

- in /usr/src/bin/adb/command.c line 177
- in /usr/src/bin/adb/expr.c line 205
- in /usr/src/bin/adb/print.c line 390, 402

NREG defined in line 144; used 3 times

- in /usr/src/bin/adb/print.c line 370, 392
- in /usr/src/bin/adb/runpcs.c line 270

NSP defined in line 129; used 7 times

- in /usr/src/bin/adb/access.c line 51
- in /usr/src/bin/adb/command.c line 79
- in /usr/src/bin/adb/format.c line 89, 219
- in /usr/src/bin/adb/opset.c line 396, 402, 447

NSYM defined in line 136; used 4 times

- in line 71
- in /usr/src/bin/adb/opset.c line 405, 450
- in /usr/src/bin/adb/sym.c line 108

OD defined in line 39; never used
OFFMODE defined in line 50; used 2 times

- in /usr/src/bin/adb/sym.c line 50, 87

ORF defined in line 47; never used
PER defined in line 41; never used
POOL defined in line 44; never used
QUOTE defined in line 174; used 2 times

- in /usr/src/bin/adb/command.c line 87-88(2)

RD defined in line 127; used 2 times

- in /usr/src/bin/adb/access.c line 30, 50

REP defined in line 40; never used
SP defined in line 171; used 9 times

- in /usr/src/bin/adb/format.c line 251
- in /usr/src/bin/adb/input.c line 20
- in /usr/src/bin/adb/output.c line 29-32(2), 40-41(2), 166-169(2)
- in /usr/src/bin/adb/runpcs.c line 140

STAR defined in line 132; used 3 times

- in /usr/src/bin/adb/access.c line 96
- in /usr/src/bin/adb/command.c line 89, 105

STRIP defined in line 169; used 2 times

- in /usr/src/bin/adb/command.c line 72
- in /usr/src/bin/adb/format.c line 250

SYMTYPE defined in line 69; used 1 times

- in /usr/src/bin/adb/sym.c line 112

TB defined in line 172; used 4 times

- in /usr/src/bin/adb/input.c line 20
- in /usr/src/bin/adb/output.c line 31, 39
- in /usr/src/bin/adb/runpcs.c line 140

THEN defined in line 31; never used
TRUE defined in line 165; used 14 times

- in /usr/src/bin/adb/command.c line 62, 119, 140, 200
- in /usr/src/bin/adb/expr.c line 158, 166, 292, 318
- in /usr/src/bin/adb/findfn.c line 38, 48
- in /usr/src/bin/adb/print.c line 144
- in /usr/src/bin/adb/sym.c line 64-70(3)

UAR0 defined in line 150; used 1 times

- in /usr/src/bin/adb/setup.c line 24

VARB defined in line 118; used 1 times

- in /usr/src/bin/adb/main.c line 105

VARC defined in line 119; used 7 times

- in /usr/src/bin/adb/access.c line 151
- in /usr/src/bin/adb/command.c line 165, 182-185(2)
- in /usr/src/bin/adb/print.c line 377
- in /usr/src/bin/adb/runpcs.c line 281
- in /usr/src/bin/adb/setup.c line 190

VARD defined in line 120; used 1 times

- in /usr/src/bin/adb/main.c line 106

VARE defined in line 121; used 1 times

- in /usr/src/bin/adb/main.c line 107

VARM defined in line 122; used 1 times

- in /usr/src/bin/adb/main.c line 108

VARO defined in line 123; used 1 times

- in /usr/src/bin/adb/main.c line 113

VARS defined in line 124; used 1 times

- in /usr/src/bin/adb/main.c line 109

VART defined in line 125; used 1 times

- in /usr/src/bin/adb/main.c line 110

WHILE defined in line 37; never used
WT defined in line 128; used 2 times

- in /usr/src/bin/adb/access.c line 23, 75

itol defined in line 185; used 4 times

- in /usr/src/bin/adb/command.c line 128
- in /usr/src/bin/adb/format.c line 93
- in /usr/src/bin/adb/output.c line 253-255(2)

leng defined in line 183; used 16 times

- in /usr/src/bin/adb/command.c line 126
- in /usr/src/bin/adb/findfn.c line 32-33(2), 51-54(2)
- in /usr/src/bin/adb/opset.c line 380
- in /usr/src/bin/adb/output.c line 253(2)
- in /usr/src/bin/adb/print.c line 248, 273-275(2), 301
- in /usr/src/bin/adb/runpcs.c line 227
- in /usr/src/bin/adb/sym.c line 66-69(2), 115

shorten defined in line 184; used 16 times

- in /usr/src/bin/adb/access.c line 64-66(2)
- in /usr/src/bin/adb/command.c line 149, 178
- in /usr/src/bin/adb/format.c line 31
- in /usr/src/bin/adb/opset.c line 379, 398
- in /usr/src/bin/adb/pcs.c line 41, 52
- in /usr/src/bin/adb/print.c line 272
- in /usr/src/bin/adb/runpcs.c line 35, 44
- in /usr/src/bin/adb/sym.c line 66, 83, 128, 224

#### Usage of this include

defs.h used 15 times

- in /usr/src/bin/adb/access.c line 1
- in /usr/src/bin/adb/command.c line 1
- in /usr/src/bin/adb/expr.c line 1
- in /usr/src/bin/adb/findfn.c line 1
- in /usr/src/bin/adb/format.c line 1
- in /usr/src/bin/adb/input.c line 1
- in /usr/src/bin/adb/main.c line 1
- in /usr/src/bin/adb/message.c line 1
- in /usr/src/bin/adb/opset.c line 5
- in /usr/src/bin/adb/output.c line 1
- in /usr/src/bin/adb/pcs.c line 1
- in /usr/src/bin/adb/print.c line 1
- in /usr/src/bin/adb/runpcs.c line 1
- in /usr/src/bin/adb/setup.c line 1
- in /usr/src/bin/adb/sym.c line 2

Last modified: 1998-04-22 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1308 |