diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-11-26 21:42:42 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-11-26 21:42:42 -0800 |
commit | 55628fb6932c0468ca7f20db6ed3ec454be8c91f (patch) | |
tree | badf837796ed5f3fa20f7df1bf070432ed0dd6e8 | |
parent | b697b343185fd60ddbf899bb2426a77cecf7306c (diff) | |
download | mu-55628fb6932c0468ca7f20db6ed3ec454be8c91f.tar.gz |
5764
-rw-r--r-- | 001help.cc | 7 | ||||
-rw-r--r-- | 003trace.cc | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/001help.cc b/001help.cc index 7236ca50..d5e2b9a2 100644 --- a/001help.cc +++ b/001help.cc @@ -78,10 +78,15 @@ void init_help() { " subx run <ELF binary>\n" "\n" "== Debugging aids\n" - "- Add '--trace' to any of these commands to save a trace.\n" + "- Add '--trace' to any of these commands to save a trace to disk at the end.\n" + " This can run out of memory for long-running commands.\n" "- Add '--debug' to add information to traces. 'subx --debug translate' will\n" " save metadata to disk that 'subx --debug --trace run' uses to make traces\n" " more informative.\n" + "- Add '--dump --trace' to emit a trace incrementally to stderr.\n" + " This approach will work even for long-running programs.\n" + " (Though the combination of flags is counter-intuitive and can probably\n" + " be improved.)\n" "\n" "Options starting with '--' must always come before any other arguments.\n" "\n" diff --git a/003trace.cc b/003trace.cc index fb2397c2..539032c7 100644 --- a/003trace.cc +++ b/003trace.cc @@ -190,6 +190,8 @@ void trace_stream::newline() { if (should_incrementally_print_trace()) { dump_trace_line(cerr, t); } + // Hack: on 'subx --trace --dump', emit only to stderr, not 'last_run'. + if (Dump_trace) past_lines.pop_back(); // economize on memory // End trace Commit } |