OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <stdarg.h> | 5 #include <stdarg.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #if V8_TARGET_ARCH_ARM | 9 #if V8_TARGET_ARCH_ARM |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 #else // ndef GENERATED_CODE_COVERAGE | 109 #else // ndef GENERATED_CODE_COVERAGE |
110 | 110 |
111 static void InitializeCoverage() { | 111 static void InitializeCoverage() { |
112 } | 112 } |
113 | 113 |
114 | 114 |
115 void ArmDebugger::Stop(Instruction* instr) { | 115 void ArmDebugger::Stop(Instruction* instr) { |
116 // Get the stop code. | 116 // Get the stop code. |
117 uint32_t code = instr->SvcValue() & kStopCodeMask; | 117 uint32_t code = instr->SvcValue() & kStopCodeMask; |
118 // Retrieve the encoded address, which comes just after this stop. | |
119 char* msg = *reinterpret_cast<char**>(sim_->get_pc() | |
120 + Instruction::kInstrSize); | |
121 // Update this stop description. | |
122 if (sim_->isWatchedStop(code) && !sim_->watched_stops_[code].desc) { | |
123 sim_->watched_stops_[code].desc = msg; | |
124 } | |
125 // Print the stop message and code if it is not the default code. | 118 // Print the stop message and code if it is not the default code. |
126 if (code != kMaxStopCode) { | 119 if (code != kMaxStopCode) { |
127 PrintF("Simulator hit stop %u: %s\n", code, msg); | 120 PrintF("Simulator hit stop %u\n", code); |
128 } else { | 121 } else { |
129 PrintF("Simulator hit %s\n", msg); | 122 PrintF("Simulator hit\n"); |
130 } | 123 } |
131 sim_->set_pc(sim_->get_pc() + 2 * Instruction::kInstrSize); | 124 sim_->set_pc(sim_->get_pc() + 2 * Instruction::kInstrSize); |
132 Debug(); | 125 Debug(); |
133 } | 126 } |
134 #endif | 127 #endif |
135 | 128 |
136 | 129 |
137 int32_t ArmDebugger::GetRegisterValue(int regnum) { | 130 int32_t ArmDebugger::GetRegisterValue(int regnum) { |
138 if (regnum == kPCRegister) { | 131 if (regnum == kPCRegister) { |
139 return sim_->get_pc(); | 132 return sim_->get_pc(); |
(...skipping 4169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4309 set_register(sp, current_sp + sizeof(uintptr_t)); | 4302 set_register(sp, current_sp + sizeof(uintptr_t)); |
4310 return address; | 4303 return address; |
4311 } | 4304 } |
4312 | 4305 |
4313 } // namespace internal | 4306 } // namespace internal |
4314 } // namespace v8 | 4307 } // namespace v8 |
4315 | 4308 |
4316 #endif // USE_SIMULATOR | 4309 #endif // USE_SIMULATOR |
4317 | 4310 |
4318 #endif // V8_TARGET_ARCH_ARM | 4311 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |