about summary refs log tree commit diff stats
path: root/031address.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-28 01:10:21 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-28 01:10:21 -0700
commitd619db37a92e744877248601e22bec4a50c9293d (patch)
treed489f74ad4b25bc268603df481764718b656a114 /031address.cc
parentf78f92c58ae49143c64b1cfec320d0579a07f859 (diff)
downloadmu-d619db37a92e744877248601e22bec4a50c9293d.tar.gz
1864
Diffstat (limited to '031address.cc')
-rw-r--r--031address.cc14
1 files changed, 13 insertions, 1 deletions
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")