Add debug flag to command line interpretation.

This commit is contained in:
Olaf Seibert 2015-05-10 17:39:38 +02:00
parent a6ee20cdc1
commit 2bc55f39f3
3 changed files with 11 additions and 4 deletions

View File

@ -18,13 +18,18 @@
to go away. Hopefully the compiler will realize when it's dead, and
eliminate it. */
static void print_tree(
void print_tree(
FILE *printfile,
EX_TREE *tp,
int depth)
{
SYMBOL *sym;
if (tp == NULL) {
fprintf(printfile, "(null)");
return;
}
switch (tp->type) {
case EX_LIT:
fprintf(printfile, "%o", tp->data.lit & 0177777);

View File

@ -279,6 +279,8 @@ int main(
} else if (!stricmp(cp, "yl1")) {
/* list the first pass, in addition to the second */
list_pass_0++;
} else if (!stricmp(cp, "yd")) {
enabl_debug++;
} else {
fprintf(stderr, "Unknown option %s\n", argv[arg]);
print_help();
@ -332,7 +334,7 @@ int main(
list_symbol_table();
}
#if 0
if (enabl_debug)
if (enabl_debug > 1)
dump_all_macros();
#endif

View File

@ -506,7 +506,7 @@ STREAM *expandmacro(
/* dump_all_macros is a diagnostic function that's currently not
used. I used it while debugging, and I haven't removed it. */
static void dump_all_macros(
void dump_all_macros(
void)
{
MACRO *mac;
@ -515,7 +515,7 @@ static void dump_all_macros(
for (mac = (MACRO *) first_sym(&macro_st, &iter); mac != NULL; mac = (MACRO *) next_sym(&macro_st, &iter)) {
dumpmacro(mac, lstfile);
printf("\n\n");
fprintf(lstfile, "\n\n");
}
}