diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc index 11a9c3930f..155aef8b8d 100644 --- a/src/arm/assembler-arm.cc +++ b/src/arm/assembler-arm.cc @@ -1656,8 +1656,14 @@ void Assembler::stop(const char* msg, Condition cond, int32_t code) { emit(reinterpret_cast(msg)); #else // def __arm__ #ifdef CAN_USE_ARMV5_INSTRUCTIONS - ASSERT(cond == al); - bkpt(0); + if (cond != al) { + Label skip; + b(&skip, NegateCondition(cond)); + bkpt(0); + bind(&skip); + } else { + bkpt(0); + } #else // ndef CAN_USE_ARMV5_INSTRUCTIONS svc(0x9f0001, cond); #endif // ndef CAN_USE_ARMV5_INSTRUCTIONS diff --git a/src/arm/constants-arm.h b/src/arm/constants-arm.h index 36f6283c96..ff814476ae 100644 --- a/src/arm/constants-arm.h +++ b/src/arm/constants-arm.h @@ -352,6 +352,11 @@ class Instr { && (Bit(20) == 0) && ((Bit(7) == 0)); } + // Test for a stop instruction. + inline bool IsStop() const { + return (TypeField() == 7) && (Bit(24) == 1) && (SvcField() >= stop); + } + // Special accessors that test for existence of a value. inline bool HasS() const { return SField() == 1; } inline bool HasB() const { return BField() == 1; } diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc index 08fbb66099..138e8f8955 100644 --- a/src/arm/simulator-arm.cc +++ b/src/arm/simulator-arm.cc @@ -455,7 +455,7 @@ void Debugger::Debug() { PrintF("DIV BY ZERO flag: %d; ", sim_->div_zero_vfp_flag_); PrintF("OVERFLOW flag: %d; ", sim_->overflow_vfp_flag_); PrintF("UNDERFLOW flag: %d; ", sim_->underflow_vfp_flag_); - PrintF("INEXACT flag: %d; ", sim_->inexact_vfp_flag_); + PrintF("INEXACT flag: %d;\n", sim_->inexact_vfp_flag_); } else if (strcmp(cmd, "stop") == 0) { int32_t value; intptr_t stop_pc = sim_->get_pc() - 2 * Instr::kInstrSize; @@ -2907,6 +2907,10 @@ void Simulator::InstructionDecode(Instr* instr) { break; } } + // If the instruction is a non taken conditional stop, we need to skip the + // inlined message address. + } else if (instr->IsStop()) { + set_pc(get_pc() + 2 * Instr::kInstrSize); } if (!pc_modified_) { set_register(pc, reinterpret_cast(instr) + Instr::kInstrSize);