|
|
1.1 root 1: /* "@(#)head.h 4.1 10/9/80" */
2: #include <sys/vm.h>
3: #define PAGSIZ (CLSIZE*NBPG)
4: #include <stdio.h>
5: #include <setjmp.h>
6: #include <sgtty.h>
7: #include "old.h"
8: #include "defs.h"
9:
10: /* new ioctls for [sg]tty() */
11: #define stty(A,B) ioctl(A, TIOCSETP, B)
12: #define gtty(A,B) ioctl(A, TIOCGETP, B)
13:
14: /* input line decoding */
15: char proc[30]; /* procedure name */
16: int integ; /* count or number in input */
17: char cmd; /* command letter */
18: char re[128]; /* regular expression */
19: char args[128]; /* arguments */
20: char *argsp; /* pointer to args */
21: char var[60]; /* variable name */
22: int scallf; /* set to 1 iff procedure call */
23: int reflag; /* set to 1 iff re */
24: int redir; /* set to 1 iff forward search */
25: int colonflag; /* set to 1 iff colon typed */
26: int ncolonflag; /* set to 1 iff colon typed after number */
27: int percentflag; /* set to 1 iff percent symbol typed */
28:
29: /* source file i/o */
30: char curfile[30]; /* name of file being edited */
31: int fline; /* line number in file */
32: char fbuf[BUFSIZ]; /* current line from file */
33: char filework[128]; /* place to put filename */
34: char *fp; /* pointer to it */
35: int nolines; /* set to 1 iff no lines in file */
36: #ifdef FLEXNAMES
37: off_t gstart; /* start of string table in a.out */
38: char *strtab; /* string table from a.out * (in core!) */
39: long ssiz; /* size of string table (for range checks) */
40: #endif
41:
42: /* returned by slookup */
43: #ifndef FLEXNAMES
44: char sl_name[8];
45: #else
46: char *sl_name;
47: #endif
48: char sl_class;
49: short sl_type;
50: int sl_size, sl_addr;
51: int subflag;
52:
53: /* procedure call information */
54: int scallx; /* procedure call in progress */
55: ADDR fps, aps, pcs; /* old stack frame */
56: BKPTR bkpts; /* old breakpoint */
57: int flagss; /* and its flags */
58: char dschar; /* '/' if value should be displayed */
59:
60: /* symbol table info */
61: long ststart; /* offset of symbol table in a.out */
62: #ifndef VMUNIX
63: struct brbuf sbuf; /* buffer for symbol table */
64: #endif
65: long extstart; /* offset of first external in a.out */
66:
67: /* address info */
68: ADDR dot; /* current address */
69: ADDR callpc, frame, argp; /* current stack frame */
70:
71: /* other */
72: char odesc[10]; /* descriptor of last displayed variable */
73: ADDR oaddr; /* address of last displayed variable */
74: char otype; /* type of last displayed variable */
75: char oclass; /* class of last displayed variable */
76: char oincr; /* size of last displayed variable */
77: struct sgttyb sdbttym, userttym;
78: /* tty modes for sdb and user */
79: char oldargs[128];
80: char prname[50]; /* print name used by outvar */
81: jmp_buf env; /* environment for setjmp, longjmp */
82: int debug; /* toggled by Y command */
83: time_t symtime; /* modification time of symfil */
84: char *symfil;
85: char *corfil;
86: ADDR exactaddr, lnfaddr; /* set by adrtolineno() */
87: ADDR firstdata; /* lowest address of data */
88:
89: #define STABMASK 0376
90: #define WINDOW 10 /* window size for display commands */
91: #define COMMANDS "\004\"+-=!/BCDMQRSTXabcdegklmpqrstwxzVXY"
92: /* each sdb command must appear here */
93: #define NUMARGS 16 /* number of args allowed in sub call */
94: #define SUBSTSP 512 /* length of space for sub args and strings */
95: #define WORDSIZE 4 /* wordsize in bytes on this machine */
96:
97: #define BIGNUM 0x7fffffff
98: #define MAXADDR 1L<<30
99:
100: struct filet {
101: #ifndef FLEXNAMES
102: char sfilename[31]; /* source file name */
103: #else
104: char *sfilename;
105: #endif
106: char lineflag; /* set iff this is a '#line' file */
107: ADDR faddr; /* address in core */
108: long stf_offset; /* offset in a.out */
109: } *files, *badfile;
110:
111: struct proct {
112: #ifndef FLEXNAMES
113: char pname[8]; /* procedure name */
114: #else
115: char *pname;
116: #endif
117: ADDR paddr; /* address in core */
118: long st_offset; /* offset in a.out */
119: struct filet *sfptr; /* source file name pointer */
120: int lineno; /* line number in source file */
121: char entrypt; /* 1 iff a F77 entry */
122: } *procs, *badproc;
123:
124:
125: #define PROCINCR 20
126: #define FILEINCR 10
127:
128: #define varchar(x) ((x>='A' && x<='Z') || (x>='a' && x<='z') || x == '_' || x == '.' || x == '[' || x == ']' || x == '-' || x == '>' || x == '*' || x == '?')
129: #define number(x) (x >= '0' && x <= '9')
130:
131: char *readline(), readchar(), rdc();
132: char *cpname();
133: char *cpstr(), *cpall();
134: char *sbrk();
135: char *typetodesc();
136: int octdigit(), decdigit(); hexdigit();
137: int octconv(), decconv(); hexconv();
138: long readint(), rint();
139: long adrtostoffset();
140: long getval(), argvalue();
141: long slookup(), globallookup();
142: ADDR varaddr(), dispvar();
143: ADDR extaddr(), formaddr(), stackreg();
144: struct proct *curproc();
145: struct proct *findproc();
146: struct proct *adrtoprocp();
147: struct proct *initframe(), *nextframe();
148: struct filet *findfile(), *adrtofilep();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.