diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-07-28 01:10:21 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-07-28 01:10:21 -0700 |
commit | d619db37a92e744877248601e22bec4a50c9293d (patch) | |
tree | d489f74ad4b25bc268603df481764718b656a114 | |
parent | f78f92c58ae49143c64b1cfec320d0579a07f859 (diff) | |
download | mu-d619db37a92e744877248601e22bec4a50c9293d.tar.gz |
1864
-rw-r--r-- | 029tools.cc | 11 | ||||
-rw-r--r-- | 031address.cc | 14 |
2 files changed, 13 insertions, 12 deletions
diff --git a/029tools.cc b/029tools.cc index 56bcc4f1..45d6a20a 100644 --- a/029tools.cc +++ b/029tools.cc @@ -203,14 +203,3 @@ case _DUMP_MEMORY: { dump_memory(); break; } - -:(before "End Primitive Recipe Declarations") -_DUMP, -:(before "End Primitive Recipe Numbers") -Recipe_ordinal["$dump"] = _DUMP; -:(before "End Primitive Recipe Implementations") -case _DUMP: { - reagent after_canonize = canonize(current_instruction().ingredients.at(0)); - cerr << current_recipe_name() << ": " << current_instruction().ingredients.at(0).name << ' ' << current_instruction().ingredients.at(0).value << " => " << after_canonize.value << " => " << Memory[after_canonize.value] << '\n'; - break; -} diff --git a/031address.cc b/031address.cc index 928b0ca7..71f29522 100644 --- a/031address.cc +++ b/031address.cc @@ -104,9 +104,21 @@ recipe main [ :(after "reagent base = " following "case GET_ADDRESS:") base = canonize(base); -//:: helper for debugging memory corruption (writing to an out-of-bounds address) +//:: helpers for debugging + +:(before "End Primitive Recipe Declarations") +_DUMP, +:(before "End Primitive Recipe Numbers") +Recipe_ordinal["$dump"] = _DUMP; +:(before "End Primitive Recipe Implementations") +case _DUMP: { + reagent after_canonize = canonize(current_instruction().ingredients.at(0)); + cerr << current_recipe_name() << ": " << current_instruction().ingredients.at(0).name << ' ' << current_instruction().ingredients.at(0).value << " => " << after_canonize.value << " => " << Memory[after_canonize.value] << '\n'; + break; +} //: grab an address, and then dump its value at intervals +//: useful for tracking down memory corruption (writing to an out-of-bounds address) :(before "End Globals") long long int foo = -1; :(before "End Primitive Recipe Declarations") |