Blame SOURCES/make-4.2-trace.patch

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