Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable runtime controlled debug output. #532

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/initkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
11 changes: 11 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down