mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-14 23:46:14 +00:00
Add extern declaration for "flushing", a flag to enable/disable calls to fflush(stdout)
after each call to printf() in the debug/tracing code. Too frequent calls slow things down. modified: inc/dbprint.h modified: src/main.c
This commit is contained in:
parent
467d33d913
commit
ef3fbc29fc
@ -38,8 +38,12 @@
|
||||
|
||||
/* For debugging print statements */
|
||||
|
||||
#if defined(DEBUG) || defined(TRACE) || defined(OPTRACE) || defined(FNTRACE) || defined(FNSTKCHECK)
|
||||
extern int flushing;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DBPRINT(X) printf X; fflush(stdout)
|
||||
#define DBPRINT(X) printf X ; if (flushing) fflush(stdout);
|
||||
#define DEBUGGER(X) X;
|
||||
#else
|
||||
#define DBPRINT(X)
|
||||
@ -50,7 +54,7 @@
|
||||
/* For trace print statements */
|
||||
|
||||
#ifdef TRACE
|
||||
#define TPRINT(X) printf X; fflush(stdout);
|
||||
#define TPRINT(X) printf X; if (flushing) fflush(stdout);
|
||||
#define TRACER(X) X;
|
||||
#else /* TRACE */
|
||||
|
||||
@ -63,7 +67,7 @@
|
||||
/* For tracing individual opcode executions */
|
||||
|
||||
#ifdef OPTRACE
|
||||
#define OPTPRINT(X) printf X; fflush(stdout);
|
||||
#define OPTPRINT(X) printf X; if (flushing) fflush(stdout);
|
||||
#define OPTRACER(X) X;
|
||||
#else
|
||||
#define OPTPRINT(X)
|
||||
@ -74,7 +78,7 @@
|
||||
/* For tracing function calls */
|
||||
|
||||
#ifdef FNTRACE
|
||||
#define FNTPRINT(X) printf X; fflush(stdout);
|
||||
#define FNTPRINT(X) printf X; if (flushing) fflush(stdout);
|
||||
#define FNTRACER(X) X;
|
||||
#else
|
||||
#define FNTPRINT(X)
|
||||
@ -85,7 +89,7 @@
|
||||
/* For function-call & return stack checking */
|
||||
|
||||
#ifdef FNSTKCHECK
|
||||
#define FNCHKPRINT(X) printf X; fflush(stdout);
|
||||
#define FNCHKPRINT(X) printf X ; if (flushing) fflush(stdout);
|
||||
#define FNCHECKER(X) X;
|
||||
#else
|
||||
#define FNCHKPRINT(X)
|
||||
|
||||
@ -273,6 +273,8 @@ int Lisp_Xinitialized = FALSE;
|
||||
char sysout_name[1024]; /* Set by read_Xoption, in the X version. */
|
||||
int sysout_size = 0; /* ditto */
|
||||
|
||||
int flushing = FALSE; /* see dbprint.h if set, all debug/trace printing will call fflush(stdout) after each printf */
|
||||
|
||||
#if defined(DOS) || defined(XWINDOW)
|
||||
#include "devif.h"
|
||||
extern DspInterface currentdsp;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user