From 601ff75bc76b5cdc76d54a399dd764cf399822e3 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 14 Dec 2015 01:30:56 -0800 Subject: three bugs fixed - notes bug in edit/ triggers in immutable but not master branch bug triggered by changes to layer 059: we're finding an unspecialized call to 'length' in 'append_6' hard to debug because trace isn't complete just bring out the big hammer: use a new log file length_2 from recipes.mu is not being deleted (bug #1) so reload doesn't switch length to length_2 when variant_already_exists (bug #2) so we end up saving in Recipe for a primitive ordinal so no valid specialization is found for 'length' (bug #3) why doesn't it trigger in a non-interactive scenario? argh, wasn't checking for an empty line at end. ok, confidence restored. --- 029tools.cc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to '029tools.cc') diff --git a/029tools.cc b/029tools.cc index 29b40836..fb52c7b4 100644 --- a/029tools.cc +++ b/029tools.cc @@ -301,3 +301,29 @@ case _DUMP_MEMORY: { dump_memory(); break; } + +//: In times of real extremis we need to create a whole new modality for debug +//: logs, independent of other changes to the screen or Trace_stream. + +:(before "End Globals") +ofstream LOG; +:(before "End One-time Setup") +//? LOG.open("log"); + +:(before "End Primitive Recipe Declarations") +_LOG, +:(before "End Primitive Recipe Numbers") +put(Recipe_ordinal, "$log", _LOG); +:(before "End Primitive Recipe Checks") +case _LOG: { + break; +} +:(before "End Primitive Recipe Implementations") +case _LOG: { + ostringstream out; + for (long long int i = 0; i < SIZE(current_instruction().ingredients); ++i) { + out << print_mu(current_instruction().ingredients.at(i), ingredients.at(i)); + } + LOG << out.str() << "(length: " << get(Recipe_ordinal, "length") << '/' << contains_key(Recipe, get(Recipe_ordinal, "length")) << ")\n"; + break; +} -- cgit 1.4.1-2-gfad0 value='6709b394fba8dbc8cdfaaf3a9461e79ce7b0c2e0'/>
path: root/source_undo.lua
blob: 60233245cb7cde73b192b943be086554a7d3fd48 (plain) (tree)