From ab02bb66328f3dd8066a32efb04d86f67f34993e Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 2 Jan 2020 02:02:37 -0800 Subject: [PATCH] 5866 Stop requiring '--debug' in 'bootstrap run'. Now it's smart enough to turn on when needed. This creates some small chance of reading stale debug info for the wrong binary, but in practice that hasn't been an issue. --- 003trace.cc | 1 + 039debug.cc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/003trace.cc b/003trace.cc index 25b21825..688ba0e1 100644 --- a/003trace.cc +++ b/003trace.cc @@ -453,6 +453,7 @@ else if (is_equal(*arg, "--trace")) { // Add a dummy line up top; otherwise the `browse_trace` tool currently has // no way to expand any lines above an error. Trace_file << " 0 dummy: start\n"; + // End --trace Settings } :(before "End trace Commit") if (Trace_file) { diff --git a/039debug.cc b/039debug.cc index bb306b06..9f2dd4bd 100644 --- a/039debug.cc +++ b/039debug.cc @@ -7,12 +7,13 @@ :(before "End Globals") map Symbol_name; // used only by 'bootstrap run' map Source_line; // used only by 'bootstrap run' -:(before "End --debug Settings") +:(before "End --trace Settings") load_labels(); load_source_lines(); :(code) void load_labels() { ifstream fin("labels"); + if (fin.fail()) return; fin >> std::hex; while (has_data(fin)) { uint32_t addr = 0; @@ -25,6 +26,7 @@ void load_labels() { void load_source_lines() { ifstream fin("source_lines"); + if (fin.fail()) return; fin >> std::hex; while (has_data(fin)) { uint32_t addr = 0;