about summary refs log tree commit diff stats
path: root/029tools.cc
diff options
context:
space:
mode:
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")