| 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_MIPS64 | 10 #if V8_TARGET_ARCH_MIPS64 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 #else // GENERATED_CODE_COVERAGE | 145 #else // GENERATED_CODE_COVERAGE |
| 146 | 146 |
| 147 #define UNSUPPORTED() printf("Sim: Unsupported instruction.\n"); | 147 #define UNSUPPORTED() printf("Sim: Unsupported instruction.\n"); |
| 148 | 148 |
| 149 static void InitializeCoverage() {} | 149 static void InitializeCoverage() {} |
| 150 | 150 |
| 151 | 151 |
| 152 void MipsDebugger::Stop(Instruction* instr) { | 152 void MipsDebugger::Stop(Instruction* instr) { |
| 153 // Get the stop code. | 153 // Get the stop code. |
| 154 uint32_t code = instr->Bits(25, 6); | 154 uint32_t code = instr->Bits(25, 6); |
| 155 // Retrieve the encoded address, which comes just after this stop. | 155 PrintF("Simulator hit (%u)\n", code); |
| 156 char* msg = *reinterpret_cast<char**>(sim_->get_pc() + | |
| 157 Instruction::kInstrSize); | |
| 158 // Update this stop description. | |
| 159 if (!sim_->watched_stops_[code].desc) { | |
| 160 sim_->watched_stops_[code].desc = msg; | |
| 161 } | |
| 162 PrintF("Simulator hit %s (%u)\n", msg, code); | |
| 163 // TODO(yuyin): 2 -> 3? | 156 // TODO(yuyin): 2 -> 3? |
| 164 sim_->set_pc(sim_->get_pc() + 3 * Instruction::kInstrSize); | 157 sim_->set_pc(sim_->get_pc() + 3 * Instruction::kInstrSize); |
| 165 Debug(); | 158 Debug(); |
| 166 } | 159 } |
| 167 #endif // GENERATED_CODE_COVERAGE | 160 #endif // GENERATED_CODE_COVERAGE |
| 168 | 161 |
| 169 | 162 |
| 170 int64_t MipsDebugger::GetRegisterValue(int regnum) { | 163 int64_t MipsDebugger::GetRegisterValue(int regnum) { |
| 171 if (regnum == kNumSimuRegisters) { | 164 if (regnum == kNumSimuRegisters) { |
| 172 return sim_->get_pc(); | 165 return sim_->get_pc(); |
| (...skipping 4821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4994 } | 4987 } |
| 4995 | 4988 |
| 4996 | 4989 |
| 4997 #undef UNSUPPORTED | 4990 #undef UNSUPPORTED |
| 4998 } // namespace internal | 4991 } // namespace internal |
| 4999 } // namespace v8 | 4992 } // namespace v8 |
| 5000 | 4993 |
| 5001 #endif // USE_SIMULATOR | 4994 #endif // USE_SIMULATOR |
| 5002 | 4995 |
| 5003 #endif // V8_TARGET_ARCH_MIPS64 | 4996 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |