-
Notifications
You must be signed in to change notification settings - Fork 1
/
dbgtr.c
93 lines (79 loc) · 2.13 KB
/
dbgtr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* Copyright (c) 1992, 2002 Michael J. Roberts. All Rights Reserved.
*
* Please see the accompanying license file, LICENSE.TXT, for information
* on using and copying this software.
*/
/*
Name
dbgtr.c - Debugging functions for run-time
Function
Provides dummy entrypoints for various debugger functions for run-time.
Notes
Eliminates a number of time- and space-consuming functions from TR.
Also defines a couple of TOKTH entrypoints since there will be no
need for a symbol table when debugging is not enabled.
Modified
12/18/92 MJRoberts - creation
*/
#include <stdlib.h>
#include "os.h"
#include "std.h"
#include "tok.h"
#include "dbg.h"
/* indicate that the debugger is not present */
int dbgpresent()
{
return FALSE;
}
static void dummy_add(toktdef *tab, char *nam, int namel, int typ,
int val, int hash) {}
static int dummy_sea(toktdef *tab, char *nam, int namel, int hash,
toksdef *ret) { return(0); }
static void dummy_set(toktdef *tab, toksdef *sym) {}
static void dummy_each(toktdef *tab, void (*fn)(void *, toksdef *),
void *fnctx) {}
uint tokhsh(char *nam) { return(0); }
/* dummy symbol table entrypoints */
void tokthini(errcxdef *ec, mcmcxdef *mctx, toktdef *symtab1)
{
tokthdef *symtab = (tokthdef *)symtab1; /* convert to correct type */
CLRSTRUCT(*symtab);
symtab1->toktfadd = dummy_add;
symtab1->toktfsea = dummy_sea;
symtab1->toktfset = dummy_set;
symtab1->toktfeach = dummy_each;
symtab1->tokterr = ec;
symtab->tokthmem = mctx;
}
/* dummy debugger entrypoints */
void dbgent(dbgcxdef *ctx, struct runsdef *bp, objnum self, objnum target,
prpnum prop, int binum, int argc)
{
}
void dbglv(dbgcxdef *ctx, int exittype)
{
}
int dbgnam(dbgcxdef *ctx, char *outbuf, int typ, int val)
{
memcpy(outbuf, "<NO SYMBOL TABLE>", (size_t)17);
return(17);
}
void dbgds(dbgcxdef *ctx)
{
VARUSED(ctx);
}
int dbgu_err_resume(dbgcxdef *ctx)
{
VARUSED(ctx);
return FALSE;
}
void dbguquitting(dbgcxdef *ctx)
{
VARUSED(ctx);
}
/*
void dbglget() {}
void dbgclin() {}
void dbgstktr() {}
*/