From 0a7ad07cc010e9f8a001ecf598f25a60b9651bd0 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 12 Nov 2025 11:21:13 +0100 Subject: [PATCH] Add a variable 'debug-out-short' to enable a shortened debug-out.txt, useful when large circuits are monitored, which otherwise may result in GigaBit size of data. --- src/frontend/inp.c | 36 +++++++++++++++++++--------------- src/frontend/inpcom.c | 45 +++++++++++++++++++++++-------------------- 2 files changed, 44 insertions(+), 37 deletions(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 603132760..97bcc16ad 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -993,19 +993,21 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) tc->linenum, tc->line); } } - fprintf(fdo, "**************** uncommented deck **************\n\n"); - /* always print first line */ - fprintf(fdo, "%6s %6d %6d %s\n", deck->linesource, deck->linenum_orig, deck->linenum, deck->line); - /* here without out-commented lines */ - for (tc = deck->nextcard; tc; tc = tc->nextcard) { - if (*(tc->line) == '*') - continue; - fprintf(fdo, "%6s %6d %6d %s\n", tc->linesource, tc->linenum_orig, tc->linenum, tc->line); + if (!cp_getvar("debug-out-short", CP_BOOL, NULL, 0)) { + fprintf(fdo, "**************** uncommented deck **************\n\n"); + /* always print first line */ + fprintf(fdo, "%6s %6d %6d %s\n", deck->linesource, deck->linenum_orig, deck->linenum, deck->line); + /* here without out-commented lines */ + for (tc = deck->nextcard; tc; tc = tc->nextcard) { + if (*(tc->line) == '*') + continue; + fprintf(fdo, "%6s %6d %6d %s\n", tc->linesource, tc->linenum_orig, tc->linenum, tc->line); + } + fprintf(fdo, "\n****************** complete deck ***************\n\n"); + /* now completely */ + for (tc = deck; tc; tc = tc->nextcard) + fprintf(fdo, "%6s %6d %6d %s\n", tc->linesource, tc->linenum_orig, tc->linenum, tc->line); } - fprintf(fdo, "\n****************** complete deck ***************\n\n"); - /* now completely */ - for (tc = deck; tc; tc = tc->nextcard) - fprintf(fdo, "%6s %6d %6d %s\n", tc->linesource, tc->linenum_orig, tc->linenum, tc->line); fclose(fdo); } else @@ -1209,10 +1211,12 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) continue; fprintf(fdo, "%6d %6d %s\n", tc->linenum_orig, tc->linenum, tc->line); } - fprintf(fdo, "\n****************** complete deck ***************\n\n"); - /* now completely */ - for (tc = deck; tc; tc = tc->nextcard) - fprintf(fdo, "%6d %6d %s\n", tc->linenum_orig, tc->linenum, tc->line); + if (!cp_getvar("debug-out-short", CP_BOOL, NULL, 0)) { + fprintf(fdo, "\n****************** complete deck ***************\n\n"); + /* now completely */ + for (tc = deck; tc; tc = tc->nextcard) + fprintf(fdo, "%6d %6d %s\n", tc->linenum_orig, tc->linenum, tc->line); + } fclose(fdo); } else diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index ae6cab075..c388d667e 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1257,32 +1257,35 @@ struct card *inp_readall(FILE *fp, const char *dir_name, const char* file_name, t->linenum, t->line); } } - fprintf(fd, - "\n\n**************** uncommented deck " - "**************\n\n"); - /* always print first line */ - fprintf(fd, "%6s %6d %6d %s\n", cc->linesource, cc->linenum_orig, cc->linenum, - cc->line); - /* here without out-commented lines */ - for (t = cc->nextcard; t; t = t->nextcard) { - if (*(t->line) == '*') - continue; - fprintf(fd, "%6s %6d %6d %s\n", - t->linesource, t->linenum_orig, t->linenum, t->line); - } - fprintf(fd, + if (!cp_getvar("debug-out-short", CP_BOOL, NULL, 0)) { + fprintf(fd, + "\n\n**************** uncommented deck " + "**************\n\n"); + /* always print first line */ + fprintf(fd, "%6s %6d %6d %s\n", cc->linesource, cc->linenum_orig, cc->linenum, + cc->line); + /* here without out-commented lines */ + for (t = cc->nextcard; t; t = t->nextcard) { + if (*(t->line) == '*') + continue; + fprintf(fd, "%6s %6d %6d %s\n", + t->linesource, t->linenum_orig, t->linenum, t->line); + } + fprintf(fd, "\n\n****************** complete deck " "***************\n\n"); - /* now completely */ - for (t = cc; t; t = t->nextcard) - fprintf(fd, "%6s %6d %6d %s\n", - t->linesource, t->linenum_orig,t->linenum, t->line); + /* now completely */ + for (t = cc; t; t = t->nextcard) + fprintf(fd, "%6s %6d %6d %s\n", + t->linesource, t->linenum_orig, t->linenum, t->line); + } fclose(fd); fprintf(stdout, - "max line length %d, max subst. per line %d, number " - "of lines %d\n", - (int) max_line_length, no_braces, dynmaxline); + "max line length %d, max subst. per line %d, number " + "of lines %d\n", + (int)max_line_length, no_braces, dynmaxline); + } else fprintf(stderr,