about summary refs log tree commit diff stats
path: root/029tools.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-10-19 15:53:09 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-10-19 15:53:09 -0700
commit61286c8d694f94d41fae7ac8b4c6ec2c6945b7bc (patch)
tree2d67264d3dbea0fdaaca7e41a0b2db7cde1c4dab /029tools.cc
parent77cdc6d03f7b5660f6df6e57a6e50b015e41e3ea (diff)
downloadmu-61286c8d694f94d41fae7ac8b4c6ec2c6945b7bc.tar.gz
2272
Diffstat (limited to '029tools.cc')
-rw-r--r--029tools.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/029tools.cc b/029tools.cc
index 8c22ad44..fa1ae463 100644
--- a/029tools.cc
+++ b/029tools.cc
@@ -166,6 +166,24 @@ case _CLEAR_TRACE: {
   break;
 }
 
+:(before "End Primitive Recipe Declarations")
+_SAVE_TRACE,
+:(before "End Primitive Recipe Numbers")
+Recipe_ordinal["$save-trace"] = _SAVE_TRACE;
+:(before "End Primitive Recipe Checks")
+case _SAVE_TRACE: {
+  break;
+}
+:(before "End Primitive Recipe Implementations")
+case _SAVE_TRACE: {
+  if (!Trace_file.empty()) {
+    ofstream fout((Trace_dir+Trace_file).c_str());
+    fout << Trace_stream->readable_contents("");
+    fout.close();
+  }
+  break;
+}
+
 //: assert: perform sanity checks at runtime
 
 :(scenario assert)
@@ -268,8 +286,6 @@ case _SYSTEM: {
   break;
 }
 
-//:: helpers for debugging
-
 :(before "End Primitive Recipe Declarations")
 _DUMP_MEMORY,
 :(before "End Primitive Recipe Numbers")