Browse Source

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.
pre-master-46
Holger Vogt 4 months ago
parent
commit
0a7ad07cc0
  1. 36
      src/frontend/inp.c
  2. 45
      src/frontend/inpcom.c

36
src/frontend/inp.c

@ -993,19 +993,21 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
tc->linenum, tc->line); 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); fclose(fdo);
} }
else else
@ -1209,10 +1211,12 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
continue; continue;
fprintf(fdo, "%6d %6d %s\n", tc->linenum_orig, tc->linenum, tc->line); 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); fclose(fdo);
} }
else else

45
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); 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****************** complete deck "
"***************\n\n"); "***************\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); fclose(fd);
fprintf(stdout, 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 else
fprintf(stderr, fprintf(stderr,

Loading…
Cancel
Save