diff -Nrup a/debug.h b/debug.h --- a/debug.h 2016-02-28 12:48:44.000000000 -0500 +++ b/debug.h 2017-06-11 10:22:11.180077939 -0400 @@ -20,6 +20,9 @@ this program. If not, see \n")); + DB( DB_EVAL, ("%s\n", argv[0])); eval_buffer (argv[0], NULL); + DBS( DB_EVAL, ("### eval <--\n")); + depth -= 1; restore_variable_buffer (buf, len); @@ -2584,6 +2590,7 @@ func_call (char *o, char **argv, const c if (v == 0 || *v->value == '\0') return o; + depth += 1; body = alloca (flen + 4); body[0] = '$'; body[1] = '('; @@ -2591,6 +2598,8 @@ func_call (char *o, char **argv, const c body[flen+2] = ')'; body[flen+3] = '\0'; + DBS(DB_CALL, ("### call %s -->\n", body)); + /* Set up arguments $(1) .. $(N). $(0) is the function name. */ push_new_variable_scope (); @@ -2600,6 +2609,7 @@ func_call (char *o, char **argv, const c char num[11]; sprintf (num, "%d", i); + DBS(DB_CALL, ("### arg %i for call %s is '%s'\n", i, body, *argv)); define_variable (num, strlen (num), *argv, o_automatic, 0); } @@ -2613,6 +2623,7 @@ func_call (char *o, char **argv, const c char num[11]; sprintf (num, "%d", i); + DBS(DB_CALL, ("### arg %i for call %s is implicit\n", i, body)); define_variable (num, strlen (num), "", o_automatic, 0); } @@ -2623,7 +2634,14 @@ func_call (char *o, char **argv, const c saved_args = max_args; max_args = i; + o = variable_expand_string (o, body, flen+3); + DBS(DB_CALL, ("### call to %s expended into\n", body)); + DB(DB_CALL, ("%s\n", o)); + DBS(DB_CALL, ("### call %s <--\n", body)); + + depth -= 1; + max_args = saved_args; v->exp_count = 0; diff -Nrup a/main.c b/main.c --- a/main.c 2017-06-11 10:20:12.053504852 -0400 +++ b/main.c 2017-06-11 10:28:37.914642751 -0400 @@ -755,6 +755,12 @@ decode_debug_flags (void) case 'b': db_level |= DB_BASIC; break; + case 'c': + db_level |= DB_CALL; + break; + case 'e': + db_level |= DB_EVAL; + break; case 'i': db_level |= DB_BASIC | DB_IMPLICIT; break;