Commit | Line | Data |
---|---|---|
d905578a TL |
1 | #include <stdio.h> |
2 | #include "bio.h" | |
3 | #include "defs.h" | |
4 | ||
5 | /* input line decoding */ | |
6 | char proc[30]; /* procedure name */ | |
7 | int integ; /* count or number in input */ | |
8 | char cmd; /* command letter */ | |
9 | char re[128]; /* regular expression */ | |
10 | char args[128]; /* arguments */ | |
11 | char *argsp; /* pointer to args */ | |
12 | char var[60]; /* variable name */ | |
13 | int scallf; /* set to 1 iff procedure call */ | |
14 | int reflag; /* set to 1 iff re */ | |
15 | int redir; /* set to 1 iff forward search */ | |
16 | ||
17 | /* source file i/o */ | |
18 | char curfile[30]; /* name of file being edited */ | |
19 | int fline; /* line number in file */ | |
20 | int maxfline; /* maximum line number in file, 0 if unknown */ | |
21 | struct brbuf fiobuf; /* file descriptor */ | |
22 | char fbuf[256]; /* current line from file */ | |
23 | char filework[128]; /* place to put filename */ | |
24 | char *fp; /* pointer to it */ | |
25 | ||
26 | /* returned by slookup */ | |
27 | char sl_name[8]; | |
28 | char sl_class, sl_type; | |
29 | int sl_size, sl_addr; | |
30 | int subflag; | |
31 | ||
32 | /* symbol table info */ | |
33 | long ststart; /* offset of symbol table in a.out */ | |
34 | struct brbuf sbuf; /* buffer for symbol table */ | |
35 | long extstart; /* offset of first external in a.out */ | |
36 | ||
37 | /* address info */ | |
38 | ADDR dot; /* current address */ | |
39 | ADDR callpc, frame, argp; /* current stack frame */ | |
40 | ||
41 | char *odesc; /* descriptor of last displayed variable */ | |
42 | char otype; /* type of last displayed variable */ | |
43 | char 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 | ||
51 | struct 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 | ||
58 | struct 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 | ||
74 | char *readline(); | |
75 | char *cpname(); | |
76 | char *cpall(); | |
77 | char *sbrk(); | |
78 | char *typetodesc(); | |
79 | int octdigit(), decdigit(); hexdigit(); | |
80 | int octconv(), decconv(); hexconv(); | |
81 | long readint(), rint(); | |
82 | long adrtostoffset(); | |
83 | long getval(), argvalue(); | |
84 | ADDR varaddr(), dispvar(); | |
85 | ADDR extaddr(); | |
86 | struct proct *curproc(); | |
87 | struct proct *findproc(); | |
88 | struct proct *adrtoproc(); | |
89 | struct proct *initframe(), *nextframe(); | |
90 | struct filet *findfile(), *adrtofilep(); | |
91 | ||
92 | #define WINDOW 10 | |
93 | #define COMMANDS "\004+-=!/abcdemnpqrstwxz" | |
94 | int debug; |