Bell 32V development
[unix-history] / usr / src / cmd / sdb / head.h
CommitLineData
d905578a
TL
1#include <stdio.h>
2#include "bio.h"
3#include "defs.h"
4
5/* input line decoding */
6char proc[30]; /* procedure name */
7int integ; /* count or number in input */
8char cmd; /* command letter */
9char re[128]; /* regular expression */
10char args[128]; /* arguments */
11char *argsp; /* pointer to args */
12char var[60]; /* variable name */
13int scallf; /* set to 1 iff procedure call */
14int reflag; /* set to 1 iff re */
15int redir; /* set to 1 iff forward search */
16
17/* source file i/o */
18char curfile[30]; /* name of file being edited */
19int fline; /* line number in file */
20int maxfline; /* maximum line number in file, 0 if unknown */
21struct brbuf fiobuf; /* file descriptor */
22char fbuf[256]; /* current line from file */
23char filework[128]; /* place to put filename */
24char *fp; /* pointer to it */
25
26/* returned by slookup */
27char sl_name[8];
28char sl_class, sl_type;
29int sl_size, sl_addr;
30int subflag;
31
32/* symbol table info */
33long ststart; /* offset of symbol table in a.out */
34struct brbuf sbuf; /* buffer for symbol table */
35long extstart; /* offset of first external in a.out */
36
37/* address info */
38ADDR dot; /* current address */
39ADDR callpc, frame, argp; /* current stack frame */
40
41char *odesc; /* descriptor of last displayed variable */
42char otype; /* type of last displayed variable */
43char oclass; /* class of last displayed variable */
44
45#define STABMASK 0376
46
47#define NUMARGS 16 /* number of args allowed in sub call */
48#define SUBSTSP 512 /* length of space for sub args and strings */
49#define WORDSIZE 4 /* wordsize in bytes on this machine */
50
51struct filet {
52 char sfilename[31]; /* source file name */
53 char lineflag; /* set iff this is a '#line' file */
54 ADDR faddr; /* address in core */
55 long stf_offset; /* offset in a.out */
56} *files, *badfile;
57
58struct proct {
59 char pname[8]; /* procedure name */
60 ADDR paddr; /* address in core */
61 long st_offset; /* offset in a.out */
62 struct filet *sfptr; /* source file name pointer */
63 int lineno; /* line number in source file */
64} *procs, *badproc;
65
66
67#define PROCINCR 20
68#define FILEINCR 10
69#define MAXADDR 1L<<30
70
71#define varchar(x) ((x>='A' && x<='Z') || (x>='a' && x<='z') || x == '_' || x == '.' || x == '[' || x == ']' || x == '-' || x == '>')
72#define number(x) (x >= '0' && x <= '9')
73
74char *readline();
75char *cpname();
76char *cpall();
77char *sbrk();
78char *typetodesc();
79int octdigit(), decdigit(); hexdigit();
80int octconv(), decconv(); hexconv();
81long readint(), rint();
82long adrtostoffset();
83long getval(), argvalue();
84ADDR varaddr(), dispvar();
85ADDR extaddr();
86struct proct *curproc();
87struct proct *findproc();
88struct proct *adrtoproc();
89struct proct *initframe(), *nextframe();
90struct filet *findfile(), *adrtofilep();
91
92#define WINDOW 10
93#define COMMANDS "\004+-=!/abcdemnpqrstwxz"
94int debug;