xref: /original-bsd/sys/deprecated/kdb/defs.h (revision 1364b7d2)
1 /*
2  * Copyright (c) 1986 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)defs.h	7.7 (Berkeley) 05/05/89
7  */
8 
9 /*
10  * adb - string table version; common definitions
11  */
12 
13 #include "param.h"
14 #include "user.h"
15 #include "proc.h"
16 
17 #include "machine/psl.h"
18 #include "machine/pte.h"
19 
20 #include <a.out.h>
21 #include <ctype.h>
22 
23 struct	pcb kdbpcb;		/* must go before redef.h */
24 
25 #include "redef.h"
26 #include "machine/kdbparam.h"
27 
28 /* access modes */
29 #define RD	0
30 #define WT	1
31 
32 #define NSP	0
33 #define	ISP	1
34 #define	DSP	2
35 #define STAR	4
36 
37 /*
38  * Symbol types, used internally in calls to findsym routine.
39  * One the VAX this all degenerates since I & D symbols are indistinct.
40  * Basically we get NSYM==0 for `=' command, ISYM==DSYM otherwise.
41  */
42 #define NSYM	0
43 #define DSYM	1		/* Data space symbol */
44 #define ISYM	DSYM		/* Instruction space symbol == DSYM on VAX */
45 
46 #define BKPTSET	1
47 #define BKPTEXEC 2
48 
49 /*
50  * setexit/reset tokens..
51  */
52 #define	ERROR	1
53 #define	NEXT	6
54 #define	SINGLE	7
55 #define	CONTIN	8
56 
57 #define LINSIZ	256
58 #define MAXOFF	1024
59 #define MAXPOS	80
60 #define MAXLIN	256
61 #define QUOTE	0200
62 
63 #define LOBYTE	0377
64 #define STRIP	0177
65 
66 #define SP	' '
67 #define TB	'\t'
68 #define EOR	'\n'
69 #define	CTRL(c)	(c&037)
70 
71 #define	eqstr(a,b)	(strcmp(a,b)==0)
72 
73 typedef	unsigned ADDR;
74 typedef	unsigned POS;
75 
76 typedef	struct bkpt {
77 	ADDR	loc;
78 	ADDR	ins;
79 	short	count;
80 	short	initcnt;
81 	short	flag;
82 #define MAXCOM	64
83 	char	comm[MAXCOM];
84 	struct	bkpt *nxtbkpt;
85 } BKPT, *BKPTR;
86 
87 typedef	struct {
88 	char	*rname;
89 	int	*rkern;
90 } REGLIST, *REGPTR;
91 
92 ADDR	maxoff;
93 ADDR	localval;
94 int	mkfault;
95 long	var[36];
96 char	*errflg;
97 long	dot;
98 int	dotinc;
99 long	adrval;
100 int	adrflg;
101 long	cntval;
102 int	cntflg;
103 
104 /* result type declarations */
105 long	inkdot();
106 u_int	get();
107 u_int	chkget();
108 u_int	bchkget();
109 char	*exform();
110 BKPTR	scanbkpt();
111 
112 struct	nlist *symtab, *esymtab;
113 struct	nlist *cursym;
114 struct	nlist *lookup();
115