| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <limits.h> | 5 #include <limits.h> |
| 6 #include <stdarg.h> | 6 #include <stdarg.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #if V8_TARGET_ARCH_MIPS | 10 #if V8_TARGET_ARCH_MIPS |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 #else // GENERATED_CODE_COVERAGE | 131 #else // GENERATED_CODE_COVERAGE |
| 132 | 132 |
| 133 #define UNSUPPORTED() printf("Sim: Unsupported instruction.\n"); | 133 #define UNSUPPORTED() printf("Sim: Unsupported instruction.\n"); |
| 134 | 134 |
| 135 static void InitializeCoverage() {} | 135 static void InitializeCoverage() {} |
| 136 | 136 |
| 137 | 137 |
| 138 void MipsDebugger::Stop(Instruction* instr) { | 138 void MipsDebugger::Stop(Instruction* instr) { |
| 139 // Get the stop code. | 139 // Get the stop code. |
| 140 uint32_t code = instr->Bits(25, 6); | 140 uint32_t code = instr->Bits(25, 6); |
| 141 // Retrieve the encoded address, which comes just after this stop. | 141 PrintF("Simulator hit (%u)\n", code); |
| 142 char* msg = *reinterpret_cast<char**>(sim_->get_pc() + | |
| 143 Instruction::kInstrSize); | |
| 144 // Update this stop description. | |
| 145 if (!sim_->watched_stops_[code].desc) { | |
| 146 sim_->watched_stops_[code].desc = msg; | |
| 147 } | |
| 148 PrintF("Simulator hit %s (%u)\n", msg, code); | |
| 149 sim_->set_pc(sim_->get_pc() + 2 * Instruction::kInstrSize); | 142 sim_->set_pc(sim_->get_pc() + 2 * Instruction::kInstrSize); |
| 150 Debug(); | 143 Debug(); |
| 151 } | 144 } |
| 152 #endif // GENERATED_CODE_COVERAGE | 145 #endif // GENERATED_CODE_COVERAGE |
| 153 | 146 |
| 154 | 147 |
| 155 int32_t MipsDebugger::GetRegisterValue(int regnum) { | 148 int32_t MipsDebugger::GetRegisterValue(int regnum) { |
| 156 if (regnum == kNumSimuRegisters) { | 149 if (regnum == kNumSimuRegisters) { |
| 157 return sim_->get_pc(); | 150 return sim_->get_pc(); |
| 158 } else { | 151 } else { |
| (...skipping 4479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4638 | 4631 |
| 4639 | 4632 |
| 4640 #undef UNSUPPORTED | 4633 #undef UNSUPPORTED |
| 4641 | 4634 |
| 4642 } // namespace internal | 4635 } // namespace internal |
| 4643 } // namespace v8 | 4636 } // namespace v8 |
| 4644 | 4637 |
| 4645 #endif // USE_SIMULATOR | 4638 #endif // USE_SIMULATOR |
| 4646 | 4639 |
| 4647 #endif // V8_TARGET_ARCH_MIPS | 4640 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |