Reviewers: ,

Description:
Fix the ARM simulator's stop support and add conditional breakpoint.

BUG=none
TEST=none


Please review this at http://codereview.chromium.org/6346009/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/arm/assembler-arm.cc
  M     src/arm/constants-arm.h
  M     src/arm/simulator-arm.cc


Index: src/arm/assembler-arm.cc
===================================================================
--- src/arm/assembler-arm.cc    (revision 6400)
+++ src/arm/assembler-arm.cc    (working copy)
@@ -1656,8 +1656,14 @@
   emit(reinterpret_cast<Instr>(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
Index: src/arm/constants-arm.h
===================================================================
--- src/arm/constants-arm.h     (revision 6400)
+++ src/arm/constants-arm.h     (working copy)
@@ -352,6 +352,11 @@
                                            && (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; }
Index: src/arm/simulator-arm.cc
===================================================================
--- src/arm/simulator-arm.cc    (revision 6400)
+++ src/arm/simulator-arm.cc    (working copy)
@@ -450,7 +450,7 @@
         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;
@@ -2902,6 +2902,10 @@
         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<int32_t>(instr) + Instr::kInstrSize);


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to