| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 cmd[COMMAND_SIZE] = 0; | 203 cmd[COMMAND_SIZE] = 0; |
| 204 arg1[ARG_SIZE] = 0; | 204 arg1[ARG_SIZE] = 0; |
| 205 arg2[ARG_SIZE] = 0; | 205 arg2[ARG_SIZE] = 0; |
| 206 | 206 |
| 207 // Undo all set breakpoints while running in the debugger shell. This will | 207 // Undo all set breakpoints while running in the debugger shell. This will |
| 208 // make them invisible to all commands. | 208 // make them invisible to all commands. |
| 209 UndoBreakpoints(); | 209 UndoBreakpoints(); |
| 210 | 210 |
| 211 while (!done) { | 211 while (!done) { |
| 212 if (last_pc != sim_->get_pc()) { | 212 if (last_pc != sim_->get_pc()) { |
| 213 disasm::Disassembler dasm; | 213 disasm::NameConverter converter; |
| 214 disasm::Disassembler dasm(converter); |
| 214 // use a reasonably large buffer | 215 // use a reasonably large buffer |
| 215 v8::internal::EmbeddedVector<char, 256> buffer; | 216 v8::internal::EmbeddedVector<char, 256> buffer; |
| 216 dasm.InstructionDecode(buffer, | 217 dasm.InstructionDecode(buffer, |
| 217 reinterpret_cast<byte*>(sim_->get_pc())); | 218 reinterpret_cast<byte*>(sim_->get_pc())); |
| 218 PrintF(" 0x%x %s\n", sim_->get_pc(), buffer.start()); | 219 PrintF(" 0x%x %s\n", sim_->get_pc(), buffer.start()); |
| 219 last_pc = sim_->get_pc(); | 220 last_pc = sim_->get_pc(); |
| 220 } | 221 } |
| 221 char* line = ReadLine("sim> "); | 222 char* line = ReadLine("sim> "); |
| 222 if (line == NULL) { | 223 if (line == NULL) { |
| 223 break; | 224 break; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 #if defined(DEBUG) | 259 #if defined(DEBUG) |
| 259 obj->PrintLn(); | 260 obj->PrintLn(); |
| 260 #endif // defined(DEBUG) | 261 #endif // defined(DEBUG) |
| 261 } else { | 262 } else { |
| 262 PrintF("%s unrecognized\n", arg1); | 263 PrintF("%s unrecognized\n", arg1); |
| 263 } | 264 } |
| 264 } else { | 265 } else { |
| 265 PrintF("printobject value\n"); | 266 PrintF("printobject value\n"); |
| 266 } | 267 } |
| 267 } else if (strcmp(cmd, "disasm") == 0) { | 268 } else if (strcmp(cmd, "disasm") == 0) { |
| 268 disasm::Disassembler dasm; | 269 disasm::NameConverter converter; |
| 270 disasm::Disassembler dasm(converter); |
| 269 // use a reasonably large buffer | 271 // use a reasonably large buffer |
| 270 v8::internal::EmbeddedVector<char, 256> buffer; | 272 v8::internal::EmbeddedVector<char, 256> buffer; |
| 271 | 273 |
| 272 byte* cur = NULL; | 274 byte* cur = NULL; |
| 273 byte* end = NULL; | 275 byte* end = NULL; |
| 274 | 276 |
| 275 if (args == 1) { | 277 if (args == 1) { |
| 276 cur = reinterpret_cast<byte*>(sim_->get_pc()); | 278 cur = reinterpret_cast<byte*>(sim_->get_pc()); |
| 277 end = cur + (10 * Instr::kInstrSize); | 279 end = cur + (10 * Instr::kInstrSize); |
| 278 } else if (args == 2) { | 280 } else if (args == 2) { |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 | 1436 |
| 1435 // Executes the current instruction. | 1437 // Executes the current instruction. |
| 1436 void Simulator::InstructionDecode(Instr* instr) { | 1438 void Simulator::InstructionDecode(Instr* instr) { |
| 1437 pc_modified_ = false; | 1439 pc_modified_ = false; |
| 1438 if (instr->ConditionField() == special_condition) { | 1440 if (instr->ConditionField() == special_condition) { |
| 1439 Debugger dbg(this); | 1441 Debugger dbg(this); |
| 1440 dbg.Stop(instr); | 1442 dbg.Stop(instr); |
| 1441 return; | 1443 return; |
| 1442 } | 1444 } |
| 1443 if (::v8::internal::FLAG_trace_sim) { | 1445 if (::v8::internal::FLAG_trace_sim) { |
| 1444 disasm::Disassembler dasm; | 1446 disasm::NameConverter converter; |
| 1447 disasm::Disassembler dasm(converter); |
| 1445 // use a reasonably large buffer | 1448 // use a reasonably large buffer |
| 1446 v8::internal::EmbeddedVector<char, 256> buffer; | 1449 v8::internal::EmbeddedVector<char, 256> buffer; |
| 1447 dasm.InstructionDecode(buffer, | 1450 dasm.InstructionDecode(buffer, |
| 1448 reinterpret_cast<byte*>(instr)); | 1451 reinterpret_cast<byte*>(instr)); |
| 1449 PrintF(" 0x%x %s\n", instr, buffer.start()); | 1452 PrintF(" 0x%x %s\n", instr, buffer.start()); |
| 1450 } | 1453 } |
| 1451 if (ConditionallyExecute(instr)) { | 1454 if (ConditionallyExecute(instr)) { |
| 1452 switch (instr->TypeField()) { | 1455 switch (instr->TypeField()) { |
| 1453 case 0: | 1456 case 0: |
| 1454 case 1: { | 1457 case 1: { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 set_register(r10, r10_val); | 1592 set_register(r10, r10_val); |
| 1590 set_register(r11, r11_val); | 1593 set_register(r11, r11_val); |
| 1591 | 1594 |
| 1592 int result = get_register(r0); | 1595 int result = get_register(r0); |
| 1593 return reinterpret_cast<Object*>(result); | 1596 return reinterpret_cast<Object*>(result); |
| 1594 } | 1597 } |
| 1595 | 1598 |
| 1596 } } // namespace assembler::arm | 1599 } } // namespace assembler::arm |
| 1597 | 1600 |
| 1598 #endif // !defined(__arm__) | 1601 #endif // !defined(__arm__) |
| OLD | NEW |