From 8aeb85f04ee68b960a6d326aca1a17dec2f6d019 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 9 Dec 2019 01:26:58 -0800 Subject: 5806 --- html/039debug.cc.html | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'html/039debug.cc.html') diff --git a/html/039debug.cc.html b/html/039debug.cc.html index a66c4991..34cb62e0 100644 --- a/html/039debug.cc.html +++ b/html/039debug.cc.html @@ -74,31 +74,31 @@ if ('onhashchange' in window) { 14 void load_labels() { 15 ifstream fin("labels"); 16 fin >> std::hex; - 17 while (has_data(fin)) { + 17 while (has_data(fin)) { 18 uint32_t addr = 0; 19 fin >> addr; 20 string name; 21 fin >> name; - 22 put(Symbol_name, addr, name); + 22 put(Symbol_name, addr, name); 23 } 24 } 25 26 void load_source_lines() { 27 ifstream fin("source_lines"); 28 fin >> std::hex; - 29 while (has_data(fin)) { + 29 while (has_data(fin)) { 30 uint32_t addr = 0; 31 fin >> addr; 32 string line; 33 getline(fin, line); - 34 put(Source_line, addr, hacky_squeeze_out_whitespace(line)); + 34 put(Source_line, addr, hacky_squeeze_out_whitespace(line)); 35 } 36 } 37 38 :(after "Run One Instruction") - 39 if (contains_key(Symbol_name, EIP)) + 39 if (contains_key(Symbol_name, EIP)) 40 trace(Callstack_depth, "run") << "== label " << get(Symbol_name, EIP) << end(); - 41 if (contains_key(Source_line, EIP)) + 41 if (contains_key(Source_line, EIP)) 42 trace(Callstack_depth, "run") << "0x" << HEXWORD << EIP << ": " << get(Source_line, EIP) << end(); 43 else 44 // no source line info; do what you can @@ -114,7 +114,7 @@ if ('onhashchange' in window) { 54 } 55 int32_t offset = read_mem_i32(inst_address+/*skip op*/1); 56 uint32_t next_eip = inst_address+/*inst length*/5+offset; - 57 if (contains_key(Symbol_name, next_eip)) + 57 if (contains_key(Symbol_name, next_eip)) 58 return "e8/call "+get(Symbol_name, next_eip); 59 ostringstream out; 60 out << "e8/call 0x" << HEXWORD << next_eip; @@ -143,26 +143,26 @@ if ('onhashchange' in window) { 83 string Watch_this_effective_address; 84 :(after "Run One Instruction") 85 Watch_this_effective_address = ""; - 86 if (contains_key(Symbol_name, EIP) && starts_with(get(Symbol_name, EIP), "$watch-")) + 86 if (contains_key(Symbol_name, EIP) && starts_with(get(Symbol_name, EIP), "$watch-")) 87 Watch_this_effective_address = get(Symbol_name, EIP); - 88 :(after "Found effective_address(addr)") + 88 :(after "Found effective_address(addr)") 89 if (!Watch_this_effective_address.empty()) { - 90 dbg << "now watching " << HEXWORD << addr << " for " << Watch_this_effective_address << end(); - 91 put(Watch_points, Watch_this_effective_address, addr); + 90 dbg << "now watching " << HEXWORD << addr << " for " << Watch_this_effective_address << end(); + 91 put(Watch_points, Watch_this_effective_address, addr); 92 } 93 94 //: Special label that dumps regions of memory. 95 //: Not a general mechanism; by the time you get here you're willing to hack 96 //: on the emulator. 97 :(after "Run One Instruction") - 98 if (contains_key(Symbol_name, EIP) && get(Symbol_name, EIP) == "$dump-stream-at-EAX") + 98 if (contains_key(Symbol_name, EIP) && get(Symbol_name, EIP) == "$dump-stream-at-EAX") 99 dump_stream_at(Reg[EAX].u); 100 :(code) 101 void dump_stream_at(uint32_t stream_start) { 102 int32_t stream_length = read_mem_i32(stream_start + 8); -103 dbg << "stream length: " << std::dec << stream_length << end(); +103 dbg << "stream length: " << std::dec << stream_length << end(); 104 for (int i = 0; i < stream_length + 12; ++i) -105 dbg << "0x" << HEXWORD << (stream_start+i) << ": " << HEXBYTE << NUM(read_mem_u8(stream_start+i)) << end(); +105 dbg << "0x" << HEXWORD << (stream_start+i) << ": " << HEXBYTE << NUM(read_mem_u8(stream_start+i)) << end(); 106 } 107 108 //: helpers -- cgit 1.4.1-2-gfad0