diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-19 15:53:09 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-19 15:53:09 -0700 |
commit | 61286c8d694f94d41fae7ac8b4c6ec2c6945b7bc (patch) | |
tree | 2d67264d3dbea0fdaaca7e41a0b2db7cde1c4dab | |
parent | 77cdc6d03f7b5660f6df6e57a6e50b015e41e3ea (diff) | |
download | mu-61286c8d694f94d41fae7ac8b4c6ec2c6945b7bc.tar.gz |
2272
-rw-r--r-- | 020run.cc | 1 | ||||
-rw-r--r-- | 029tools.cc | 20 |
2 files changed, 18 insertions, 3 deletions
diff --git a/020run.cc b/020run.cc index 8f471b56..5ca093e7 100644 --- a/020run.cc +++ b/020run.cc @@ -162,7 +162,6 @@ if (!Run_tests) { setup(); //? Trace_file = "interactive"; //? START_TRACING_UNTIL_END_OF_SCOPE; -//? Trace_stream->collect_layers.insert("app"); run_main(argc, argv); teardown(); } 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") |