From d619db37a92e744877248601e22bec4a50c9293d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 28 Jul 2015 01:10:21 -0700 Subject: 1864 --- 031address.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to '031address.cc') 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") -- cgit 1.4.1-2-gfad0