Index: runtime/vm/simulator_arm64.cc |
=================================================================== |
--- runtime/vm/simulator_arm64.cc (revision 45318) |
+++ runtime/vm/simulator_arm64.cc (working copy) |
@@ -1689,22 +1689,23 @@ |
(instr->Bits(21, 3) == 1)) { |
// Format(instr, "brk 'imm16"); |
SimulatorDebugger dbg(this); |
- uint16_t imm = static_cast<uint16_t>(instr->Imm16Field()); |
- char buffer[32]; |
- snprintf(buffer, sizeof(buffer), "brk #0x%x", imm); |
- set_pc(get_pc() + Instr::kInstrSize); |
- dbg.Stop(instr, buffer); |
- } else if ((instr->Bits(0, 2) == 0) && (instr->Bits(2, 3) == 0) && |
- (instr->Bits(21, 3) == 2)) { |
- // Format(instr, "hlt 'imm16"); |
- uint16_t imm = static_cast<uint16_t>(instr->Imm16Field()); |
+ int32_t imm = instr->Imm16Field(); |
if (imm == Instr::kStopMessageCode) { |
- SimulatorDebugger dbg(this); |
const char* message = *reinterpret_cast<const char**>( |
reinterpret_cast<intptr_t>(instr) - 2 * Instr::kInstrSize); |
set_pc(get_pc() + Instr::kInstrSize); |
dbg.Stop(instr, message); |
- } else if (imm == Instr::kSimulatorBreakCode) { |
+ } else { |
+ char buffer[32]; |
+ snprintf(buffer, sizeof(buffer), "brk #0x%x", imm); |
+ set_pc(get_pc() + Instr::kInstrSize); |
+ dbg.Stop(instr, buffer); |
+ } |
+ } else if ((instr->Bits(0, 2) == 0) && (instr->Bits(2, 3) == 0) && |
+ (instr->Bits(21, 3) == 2)) { |
+ // Format(instr, "hlt 'imm16"); |
+ uint16_t imm = static_cast<uint16_t>(instr->Imm16Field()); |
+ if (imm == Instr::kSimulatorBreakCode) { |
SimulatorDebugger dbg(this); |
dbg.Stop(instr, "breakpoint"); |
} else if (imm == Instr::kSimulatorRedirectCode) { |