| Index: src/arm/simulator-arm.cc
|
| diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc
|
| index aa50732f0211ed9992adf3d6c3ca2af0805c7e0d..454c2afc4a0617f330cda4b9d12fa0c01f65c95d 100644
|
| --- a/src/arm/simulator-arm.cc
|
| +++ b/src/arm/simulator-arm.cc
|
| @@ -75,6 +75,7 @@ class Debugger {
|
| Simulator* sim_;
|
|
|
| int32_t GetRegisterValue(int regnum);
|
| + double GetVFPDoubleRegisterValue(int regnum);
|
| bool GetValue(const char* desc, int32_t* value);
|
| bool GetVFPSingleValue(const char* desc, float* value);
|
| bool GetVFPDoubleValue(const char* desc, double* value);
|
| @@ -169,6 +170,11 @@ int32_t Debugger::GetRegisterValue(int regnum) {
|
| }
|
|
|
|
|
| +double Debugger::GetVFPDoubleRegisterValue(int regnum) {
|
| + return sim_->get_double_from_d_register(regnum);
|
| +}
|
| +
|
| +
|
| bool Debugger::GetValue(const char* desc, int32_t* value) {
|
| int regnum = Registers::Number(desc);
|
| if (regnum != kNoRegister) {
|
| @@ -310,6 +316,11 @@ void Debugger::Debug() {
|
| value = GetRegisterValue(i);
|
| PrintF("%3s: 0x%08x %10d\n", Registers::Name(i), value, value);
|
| }
|
| + for (int i = 0; i < kNumVFPDoubleRegisters; i++) {
|
| + dvalue = GetVFPDoubleRegisterValue(i);
|
| + PrintF("%3s: %f\n",
|
| + VFPRegisters::Name(i, true), dvalue);
|
| + }
|
| } else {
|
| if (GetValue(arg1, &value)) {
|
| PrintF("%s: 0x%08x %d \n", arg1, value, value);
|
| @@ -838,6 +849,11 @@ void Simulator::set_pc(int32_t value) {
|
| }
|
|
|
|
|
| +bool Simulator::has_bad_pc() const {
|
| + return ((registers_[pc] == bad_lr) || (registers_[pc] == end_sim_pc));
|
| +}
|
| +
|
| +
|
| // Raw access to the PC register without the special adjustment when reading.
|
| int32_t Simulator::get_pc() const {
|
| return registers_[pc];
|
| @@ -1511,7 +1527,8 @@ void Simulator::HandleRList(Instr* instr, bool load) {
|
| typedef int64_t (*SimulatorRuntimeCall)(int32_t arg0,
|
| int32_t arg1,
|
| int32_t arg2,
|
| - int32_t arg3);
|
| + int32_t arg3,
|
| + int32_t arg4);
|
| typedef double (*SimulatorRuntimeFPCall)(int32_t arg0,
|
| int32_t arg1,
|
| int32_t arg2,
|
| @@ -1534,6 +1551,8 @@ void Simulator::SoftwareInterrupt(Instr* instr) {
|
| int32_t arg1 = get_register(r1);
|
| int32_t arg2 = get_register(r2);
|
| int32_t arg3 = get_register(r3);
|
| + int32_t* stack_pointer = reinterpret_cast<int32_t*>(get_register(sp));
|
| + int32_t arg4 = *stack_pointer;
|
| // This is dodgy but it works because the C entry stubs are never moved.
|
| // See comment in codegen-arm.cc and bug 1242173.
|
| int32_t saved_lr = get_register(lr);
|
| @@ -1562,19 +1581,20 @@ void Simulator::SoftwareInterrupt(Instr* instr) {
|
| reinterpret_cast<SimulatorRuntimeCall>(external);
|
| if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
|
| PrintF(
|
| - "Call to host function at %p with args %08x, %08x, %08x, %08x",
|
| + "Call to host function at %p args %08x, %08x, %08x, %08x, %0xc",
|
| FUNCTION_ADDR(target),
|
| arg0,
|
| arg1,
|
| arg2,
|
| - arg3);
|
| + arg3,
|
| + arg4);
|
| if (!stack_aligned) {
|
| PrintF(" with unaligned stack %08x\n", get_register(sp));
|
| }
|
| PrintF("\n");
|
| }
|
| CHECK(stack_aligned);
|
| - int64_t result = target(arg0, arg1, arg2, arg3);
|
| + int64_t result = target(arg0, arg1, arg2, arg3, arg4);
|
| int32_t lo_res = static_cast<int32_t>(result);
|
| int32_t hi_res = static_cast<int32_t>(result >> 32);
|
| if (::v8::internal::FLAG_trace_sim) {
|
| @@ -1909,9 +1929,12 @@ void Simulator::DecodeType01(Instr* instr) {
|
| set_register(lr, old_pc + Instr::kInstrSize);
|
| break;
|
| }
|
| - case BKPT:
|
| - v8::internal::OS::DebugBreak();
|
| + case BKPT: {
|
| + Debugger dbg(this);
|
| + PrintF("Simulator hit BKPT.\n");
|
| + dbg.Debug();
|
| break;
|
| + }
|
| default:
|
| UNIMPLEMENTED();
|
| }
|
|
|