about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--001help.cc7
-rw-r--r--003trace.cc2
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
   }