Index: runtime/vm/simulator_arm.cc |
=================================================================== |
--- runtime/vm/simulator_arm.cc (revision 45360) |
+++ runtime/vm/simulator_arm.cc (working copy) |
@@ -1506,7 +1506,7 @@ |
void Simulator::SupervisorCall(Instr* instr) { |
int svc = instr->SvcField(); |
switch (svc) { |
- case kRedirectionSvcCode: { |
+ case Instr::kSimulatorRedirectCode: { |
SimulatorSetjmpBuffer buffer(this); |
if (!setjmp(buffer.buffer_)) { |
@@ -1627,19 +1627,11 @@ |
break; |
} |
- case kBreakpointSvcCode: { |
+ case Instr::kSimulatorBreakCode: { |
SimulatorDebugger dbg(this); |
dbg.Stop(instr, "breakpoint"); |
break; |
} |
- case kStopMessageSvcCode: { |
- SimulatorDebugger dbg(this); |
- const char* message = *reinterpret_cast<const char**>( |
- reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize); |
- set_pc(get_pc() + Instr::kInstrSize); |
- dbg.Stop(instr, message); |
- break; |
- } |
default: { |
UNREACHABLE(); |
break; |
@@ -1696,10 +1688,18 @@ |
if ((instr->Bits(21, 2) == 0x1) && (instr->ConditionField() == AL)) { |
// Format(instr, "bkpt #'imm12_4"); |
SimulatorDebugger dbg(this); |
- set_pc(get_pc() + Instr::kInstrSize); |
- char buffer[32]; |
- snprintf(buffer, sizeof(buffer), "bkpt #0x%x", instr->BkptField()); |
- dbg.Stop(instr, buffer); |
+ int32_t imm = instr->BkptField(); |
+ if (imm == Instr::kStopMessageCode) { |
+ const char* message = *reinterpret_cast<const char**>( |
+ reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize); |
+ set_pc(get_pc() + Instr::kInstrSize); |
+ dbg.Stop(instr, message); |
+ } else { |
+ char buffer[32]; |
+ snprintf(buffer, sizeof(buffer), "bkpt #0x%x", imm); |
+ set_pc(get_pc() + Instr::kInstrSize); |
+ dbg.Stop(instr, buffer); |
+ } |
} else { |
// Format(instr, "smc'cond"); |
UnimplementedInstruction(instr); |