From 9c1056f531217f3c1c12b3b3a648ca1cffe4beab Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 29 Mar 2019 00:47:30 -0700 Subject: 5033 --- html/subx/039debug.cc.html | 68 ++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 30 deletions(-) (limited to 'html/subx/039debug.cc.html') diff --git a/html/subx/039debug.cc.html b/html/subx/039debug.cc.html index 3ea1126f..e50b1c9a 100644 --- a/html/subx/039debug.cc.html +++ b/html/subx/039debug.cc.html @@ -81,37 +81,45 @@ if ('onhashchange' in window) { 22 23 :(after "Run One Instruction") 24 if (contains_key(Symbol_name, EIP)) -25 trace(Callstack_depth, "run") << "== label " << get(Symbol_name, EIP) << end(); +25 trace(Callstack_depth, "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(); -33 :(before "End Globals") -34 map<string, uint32_t> Watch_points; -35 :(before "End Reset") -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(); -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); -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 put(Watch_points, Watch_this_effective_address, addr); -55 } +27 //: make calls in particular more salient +28 :(before "End Trace Call Instruction") +29 // at this point we've skipped past the e8 opcode, but not the offset operand +30 int32_t offset = read_mem_i32(EIP); +31 uint32_t next_eip = EIP+offset+4; +32 if (contains_key(Symbol_name, next_eip)) +33 return "/call "+get(Symbol_name, next_eip); +34 +35 //: If a label starts with '$watch-', make a note of the effective address +36 //: computed by the next instruction. Start dumping out its contents to the +37 //: trace after every subsequent instruction. +38 +39 :(after "Run One Instruction") +40 dump_watch_points(); +41 :(before "End Globals") +42 map<string, uint32_t> Watch_points; +43 :(before "End Reset") +44 Watch_points.clear(); +45 :(code) +46 void dump_watch_points() { +47 if (Watch_points.empty()) return; +48 dbg << "watch points:" << end(); +49 for (map<string, uint32_t>::iterator p = Watch_points.begin(); p != Watch_points.end(); ++p) +50 dbg << " " << p->first << ": " << HEXWORD << p->second << " -> " << HEXWORD << read_mem_u32(p->second) << end(); +51 } +52 +53 :(before "End Globals") +54 string Watch_this_effective_address; +55 :(after "Run One Instruction") +56 Watch_this_effective_address = ""; +57 if (contains_key(Symbol_name, EIP) && starts_with(get(Symbol_name, EIP), "$watch-")) +58 Watch_this_effective_address = get(Symbol_name, EIP); +59 :(after "Found effective_address(addr)") +60 if (!Watch_this_effective_address.empty()) { +61 dbg << "now watching " << HEXWORD << addr << " for " << Watch_this_effective_address << end(); +62 put(Watch_points, Watch_this_effective_address, addr); +63 } -- cgit 1.4.1-2-gfad0