diff --git a/html/subx/039debug.cc.html b/html/subx/039debug.cc.html index 8983218e..df6a779a 100644 --- a/html/subx/039debug.cc.html +++ b/html/subx/039debug.cc.html @@ -63,54 +63,54 @@ if ('onhashchange' in window) { 4 //: (It'll only affect the trace.) 5 6 :(before "End Globals") - 7 map</*address*/uint32_t, string> Symbol_name; // used only by 'subx run' + 7 map</*address*/uint32_t, string> Symbol_name; // used only by 'subx run' 8 :(before "End --map Settings") - 9 load_map("map"); + 9 load_map("map"); 10 :(code) -11 void load_map(const string& map_filename) { +11 void load_map(const string& map_filename) { 12 ifstream fin(map_filename.c_str()); 13 fin >> std::hex; -14 while (has_data(fin)) { +14 while (has_data(fin)) { 15 uint32_t addr = 0; 16 fin >> addr; 17 string name; 18 fin >> name; -19 put(Symbol_name, addr, name); +19 put(Symbol_name, addr, name); 20 } 21 } 22 23 :(after "Run One Instruction") -24 if (contains_key(Symbol_name, EIP)) -25 trace(90, "run") << "== label " << get(Symbol_name, EIP) << end(); +24 if (contains_key(Symbol_name, EIP)) +25 trace(90, "run") << "== label " << get(Symbol_name, EIP) << end(); 26 27 //: If a label starts with '$watch-', make a note of the effective address 28 //: computed by the next instruction. Start dumping out its contents to the 29 //: trace after every subsequent instruction. 30 31 :(after "Run One Instruction") -32 dump_watch_points(); +32 dump_watch_points(); 33 :(before "End Globals") -34 map<string, uint32_t> Watch_points; +34 map<string, uint32_t> Watch_points; 35 :(before "End Reset") -36 Watch_points.clear(); +36 Watch_points.clear(); 37 :(code) -38 void dump_watch_points() { -39 if (Watch_points.empty()) return; -40 dbg << "watch points:" << end(); -41 for (map<string, uint32_t>::iterator p = Watch_points.begin(); p != Watch_points.end(); ++p) -42 dbg << " " << p->first << ": " << HEXWORD << p->second << " -> " << HEXWORD << read_mem_u32(p->second) << end(); +38 void dump_watch_points() { +39 if (Watch_points.empty()) return; +40 dbg << "watch points:" << end(); +41 for (map<string, uint32_t>::iterator p = Watch_points.begin(); p != Watch_points.end(); ++p) +42 dbg << " " << p->first << ": " << HEXWORD << p->second << " -> " << HEXWORD << read_mem_u32(p->second) << end(); 43 } 44 45 :(before "End Globals") 46 string Watch_this_effective_address; 47 :(after "Run One Instruction") 48 Watch_this_effective_address = ""; -49 if (contains_key(Symbol_name, EIP) && starts_with(get(Symbol_name, EIP), "$watch-")) -50 Watch_this_effective_address = get(Symbol_name, EIP); +49 if (contains_key(Symbol_name, EIP) && starts_with(get(Symbol_name, EIP), "$watch-")) +50 Watch_this_effective_address = get(Symbol_name, EIP); 51 :(after "Found effective_address(addr)") 52 if (!Watch_this_effective_address.empty()) { -53 dbg << "now watching " << HEXWORD << addr << " for " << Watch_this_effective_address << end(); -54 Watch_points[Watch_this_effective_address] = addr; +53 dbg << "now watching " << HEXWORD << addr << " for " << Watch_this_effective_address << end(); +54 put(Watch_points, Watch_this_effective_address, addr); 55 } diff --git a/subx/039debug.cc b/subx/039debug.cc index 83ae3f52..4dfcfa3c 100644 --- a/subx/039debug.cc +++ b/subx/039debug.cc @@ -51,5 +51,5 @@ if (contains_key(Symbol_name, EIP) && starts_with(get(Symbol_name, EIP), "$watch :(after "Found effective_address(addr)") if (!Watch_this_effective_address.empty()) { dbg << "now watching " << HEXWORD << addr << " for " << Watch_this_effective_address << end(); - Watch_points[Watch_this_effective_address] = addr; + put(Watch_points, Watch_this_effective_address, addr); }