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