1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-03-15 14:27:19 +00:00

Compare commits

...

1 Commits

Author SHA1 Message Date
Matt Heffron
966290ff4d Enable runtime controlled debug output.
Currently only in make_X_keymap.
Output is to STDOUT (since the conditional compilation DEBUG did)

Medley branch: mth38--command-line-arg-to-support-maiko-runtime-debug adds command line argument support for this.
2025-02-17 12:35:02 -08:00
2 changed files with 27 additions and 0 deletions

View File

@@ -71,6 +71,8 @@ extern DspInterface currentdsp;
extern int LispKbdFd;
int LispKbdFd = -1;
extern int runtime_debug_level;
extern fd_set LispReadFds;
extern DLword *EmMouseX68K;
@@ -375,6 +377,20 @@ static u_char *make_X_keymap(void) {
table[xcode - 7] = code;
}
if (runtime_debug_level > 0) {
printf("*********************************************************************\n");
printf("(DEFINE-FILE-INFO \036PACKAGE \"INTERLISP\" \036READTABLE \"XCL\" \036 BASE 10)\n");
printf("(SETQ XGetKeyboardMappingTable '(\n");
for (i = 0; i < codecount * symspercode; i += symspercode) {
printf("(%d (", minkey + (i / symspercode));
for (int j = 0; j < symspercode; j++) {
printf(" #X%lx", (unsigned long)mapping[i+j]);
}
printf(" ))\n");
}
printf("\n))\nSTOP\n");
printf("*********************************************************************\n");
}
#ifdef DEBUG
printf("\n\n\tXGetKeyboardMapping table\n\n");
for (i = 0; i < codecount * symspercode; i += symspercode) {

View File

@@ -226,6 +226,8 @@ int save_argc;
char **save_argv;
int display_max = 65536 * 16 * 2;
long runtime_debug_level = 0;
/* diagnostic flag for sysout dumping */
extern unsigned maxpages;
@@ -345,6 +347,7 @@ int main(int argc, char *argv[])
{
int i;
char *envname;
char *rtdebug;
extern int TIMER_INTERVAL;
extern fd_set LispReadFds;
long tmpint;
@@ -677,6 +680,14 @@ int main(int argc, char *argv[])
//
//
if ((rtdebug = getenv("LDERUNTIMEDEBUG")) != NULL) {
errno = 0;
runtime_debug_level = strtol(rtdebug, (char **)NULL, 10);
if (errno != 0) {
runtime_debug_level = 0; // default to OFF if erroneous value
}
}
/* Sanity checks. */
#ifdef DOS