Chromium Code Reviews| Index: runtime/vm/simulator_mips.cc |
| =================================================================== |
| --- runtime/vm/simulator_mips.cc (revision 42212) |
| +++ runtime/vm/simulator_mips.cc (working copy) |
| @@ -105,10 +105,6 @@ |
| bool is_inlined); |
| void PrintBacktrace(); |
| - static const int32_t kSimulatorBreakpointInstruction = |
| - Instr::kBreakPointInstruction | |
| - (Instr::kSimulatorBreakCode << kBreakCodeShift); |
| - |
| // Set or delete a breakpoint. Returns true if successful. |
| bool SetBreakpoint(Instr* breakpc); |
| bool DeleteBreakpoint(Instr* breakpc); |
| @@ -393,7 +389,7 @@ |
| void SimulatorDebugger::RedoBreakpoints() { |
| if (sim_->break_pc_ != NULL) { |
| - sim_->break_pc_->SetInstructionBits(kSimulatorBreakpointInstruction); |
| + sim_->break_pc_->SetInstructionBits(Instr::kSimulatorBreakpointInstruction); |
| } |
| } |
| @@ -561,7 +557,6 @@ |
| end = start + (length * Instr::kInstrSize); |
| } |
| } |
| - |
| Disassembler::Disassemble(start, end); |
|
zra
2014/12/09 18:50:41
Same comment.
regis
2014/12/09 19:23:25
Done.
|
| } else if (strcmp(cmd, "gdb") == 0) { |
| OS::Print("relinquishing control to gdb\n"); |
| @@ -781,9 +776,6 @@ |
| } |
| private: |
| - static const int32_t kRedirectInstruction = |
| - Instr::kBreakPointInstruction | (Instr::kRedirectCode << kBreakCodeShift); |
| - |
| Redirection(uword external_function, |
| Simulator::CallKind call_kind, |
| int argument_count) |
| @@ -790,7 +782,7 @@ |
| : external_function_(external_function), |
| call_kind_(call_kind), |
| argument_count_(argument_count), |
| - break_instruction_(kRedirectInstruction), |
| + break_instruction_(Instr::kSimulatorRedirectInstruction), |
| next_(list_) { |
| list_ = this; |
| } |
| @@ -1118,7 +1110,7 @@ |
| bool result = false; |
| for (int i = 0; i < kNumAddressTags; i++) { |
| if (exclusive_access_state_[i].isolate == isolate) { |
| - // Check whether the current isolates address reservation matches. |
| + // Check whether the current isolate's address reservation matches. |
| if (exclusive_access_state_[i].addr == addr) { |
| result = true; |
| } |
| @@ -1203,7 +1195,7 @@ |
| dbg.Stop(instr, message); |
| // Adjust for extra pc increment. |
| set_pc(get_pc() - Instr::kInstrSize); |
| - } else if (instr->BreakCodeField() == Instr::kMsgMessageCode) { |
| + } else if (instr->BreakCodeField() == Instr::kSimulatorMessageCode) { |
| const char* message = *reinterpret_cast<const char**>( |
| reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize); |
| if (FLAG_trace_sim) { |
| @@ -1212,7 +1204,7 @@ |
| OS::PrintErr("Bad break code: 0x%x\n", instr->InstructionBits()); |
| UnimplementedInstruction(instr); |
| } |
| - } else if (instr->BreakCodeField() == Instr::kRedirectCode) { |
| + } else if (instr->BreakCodeField() == Instr::kSimulatorRedirectCode) { |
| SimulatorSetjmpBuffer buffer(this); |
| if (!setjmp(buffer.buffer_)) { |
| @@ -2299,20 +2291,18 @@ |
| // FLAG_stop_sim_at is at the non-default value. Stop in the debugger when |
| // we reach the particular instruction count or address. |
| while (pc_ != kEndSimulatingPC) { |
| + Instr* instr = Instr::At(pc_); |
| icount_++; |
| - Instr* instr = Instr::At(pc_); |
| - if (static_cast<int>(icount_) == FLAG_stop_sim_at) { |
| + if (static_cast<intptr_t>(icount_) == FLAG_stop_sim_at) { |
| SimulatorDebugger dbg(this); |
| dbg.Stop(instr, "Instruction count reached"); |
| - } else if (reinterpret_cast<int>(instr) == FLAG_stop_sim_at) { |
| + } else if (reinterpret_cast<intptr_t>(instr) == FLAG_stop_sim_at) { |
| SimulatorDebugger dbg(this); |
| dbg.Stop(instr, "Instruction address reached"); |
| + } else if (IsIllegalAddress(pc_)) { |
| + HandleIllegalAccess(pc_, instr); |
| } else { |
| - if (IsIllegalAddress(pc_)) { |
| - HandleIllegalAccess(pc_, instr); |
| - } else { |
| - InstructionDecode(instr); |
| - } |
| + InstructionDecode(instr); |
| } |
| } |
| } |