about summary refs log tree commit diff stats
path: root/026call.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-11-19 02:36:35 -0800
committerKartik K. Agaram <vc@akkartik.com>2017-11-19 02:36:35 -0800
commitf64f1ca50ead1af7feeb76b9a1d86e7a07060387 (patch)
tree00e8cc7bf87a8338fc9c48641d15c259d83719a9 /026call.cc
parentc6ab07f7006161b7b21181ff3385dcf6bf01770b (diff)
downloadmu-f64f1ca50ead1af7feeb76b9a1d86e7a07060387.tar.gz
4125
Diffstat (limited to '026call.cc')
-rw-r--r--026call.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/026call.cc b/026call.cc
index d718a9ce..d44188bf 100644
--- a/026call.cc
+++ b/026call.cc
@@ -203,3 +203,18 @@ while (current_step_index() >= SIZE(Current_routine->steps())) {
   // todo: fail if no products returned
   ++current_step_index();
 }
+
+:(before "End Primitive Recipe Declarations")
+_DUMP_CALL_STACK,
+:(before "End Primitive Recipe Numbers")
+put(Recipe_ordinal, "$dump-call-stack", _DUMP_CALL_STACK);
+:(before "End Primitive Recipe Checks")
+case _DUMP_CALL_STACK: {
+  break;
+}
+:(before "End Primitive Recipe Implementations")
+case _DUMP_CALL_STACK: {
+  for (call_stack::const_reverse_iterator p = Current_routine->calls.rbegin(); p != Current_routine->calls.rend(); ++p)
+    cerr << get(Recipe, p->running_recipe).name << ":" << p->running_step_index << " -- " << to_string(to_instruction(*p)) << '\n';
+  break;
+}