Split the "-ds" debug flag into "-ds" and "-dh"

-ds prints parsed expressions
   -dh dumps hash-table statistics on exit.
This commit is contained in:
Dianne Skoll
2024-12-31 12:50:15 -05:00
parent 562cec3dc8
commit 213138a7b7
7 changed files with 15 additions and 4 deletions

View File

@@ -315,6 +315,9 @@ Trace the reading of reminder files
Trace expression parsing and display the internal expression node
tree. This is unlikely to be useful unless you are working on
\fBRemind\fR's expression evaluation engine.
.TP
.B h
Dump hash-table statistics on exit.
.RE
.TP
\fB\-g\fR[\fBa|d\fR[\fBa|d\fR[\fBa|d\fR[\fBa|d\fR]]]]

View File

@@ -634,6 +634,7 @@ void InitRemind(int argc, char const *argv[])
while (*arg) {
switch(*arg++) {
case 's': case 'S': DebugFlag |= DB_PARSE_EXPR; break;
case 'h': case 'H': DebugFlag |= DB_HASHSTATS; break;
case 'e': case 'E': DebugFlag |= DB_ECHO_LINE; break;
case 'x': case 'X': DebugFlag |= DB_PRTEXPR; break;
case 't': case 'T': DebugFlag |= DB_PRTTRIG; break;

View File

@@ -60,7 +60,7 @@ exitfunc(void)
/* Kill any execution-time-limiter process */
unlimit_execution_time();
if (DebugFlag & DB_PARSE_EXPR) {
if (DebugFlag & DB_HASHSTATS) {
fflush(stdout);
fflush(ErrFp);
fprintf(ErrFp, "Variable hash table statistics:\n");
@@ -1273,6 +1273,12 @@ int DoDebug(ParsePtr p)
else DebugFlag &= ~DB_PARSE_EXPR;
break;
case 'h':
case 'H':
if (val) DebugFlag |= DB_HASHSTATS;
else DebugFlag &= ~DB_HASHSTATS;
break;
case 'x':
case 'X':
if (val) DebugFlag |= DB_PRTEXPR;

View File

@@ -207,6 +207,7 @@ typedef Parser *ParsePtr; /* Pointer to parser structure */
#define DB_ECHO_LINE 16
#define DB_TRACE_FILES 32
#define DB_PARSE_EXPR 64
#define DB_HASHSTATS 128
/* Enumeration of the tokens */
enum TokTypes

View File

@@ -1,4 +1,4 @@
debug +sx
debug +hsx
set a 1

View File

@@ -1440,7 +1440,7 @@ do "with space.rem"
DEBUG -e
# Output expression-node stats
DEBUG +s
DEBUG +h
# Don't want Remind to queue reminders
EXIT

View File

@@ -600001,4 +600001,4 @@ TRANSLATE "99999"
SET BOOGIE 1
FSET QUUX(x) x*2
TRANSLATE "A" "B"
DEBUG +s
DEBUG +h