| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <setjmp.h> // NOLINT | 5 #include <setjmp.h> // NOLINT |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #if defined(TARGET_ARCH_ARM) | 9 #if defined(TARGET_ARCH_ARM) |
| 10 | 10 |
| 11 // Only build the simulator if not compiling for real ARM hardware. | 11 // Only build the simulator if not compiling for real ARM hardware. |
| 12 #if !defined(HOST_ARCH_ARM) | 12 #if defined(USING_SIMULATOR) |
| 13 | 13 |
| 14 #include "vm/simulator.h" | 14 #include "vm/simulator.h" |
| 15 | 15 |
| 16 #include "vm/assembler.h" | 16 #include "vm/assembler.h" |
| 17 #include "vm/constants_arm.h" | 17 #include "vm/constants_arm.h" |
| 18 #include "vm/cpu.h" | 18 #include "vm/cpu.h" |
| 19 #include "vm/disassembler.h" | 19 #include "vm/disassembler.h" |
| 20 #include "vm/lockers.h" | 20 #include "vm/lockers.h" |
| 21 #include "vm/native_arguments.h" | 21 #include "vm/native_arguments.h" |
| 22 #include "vm/stack_frame.h" | 22 #include "vm/stack_frame.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) { | 450 } else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) { |
| 451 // Execute the one instruction we broke at with breakpoints disabled. | 451 // Execute the one instruction we broke at with breakpoints disabled. |
| 452 sim_->InstructionDecode(reinterpret_cast<Instr*>(sim_->get_pc())); | 452 sim_->InstructionDecode(reinterpret_cast<Instr*>(sim_->get_pc())); |
| 453 // Leave the debugger shell. | 453 // Leave the debugger shell. |
| 454 done = true; | 454 done = true; |
| 455 } else if ((strcmp(cmd, "p") == 0) || (strcmp(cmd, "print") == 0)) { | 455 } else if ((strcmp(cmd, "p") == 0) || (strcmp(cmd, "print") == 0)) { |
| 456 if (args == 2) { | 456 if (args == 2) { |
| 457 uint32_t value; | 457 uint32_t value; |
| 458 if (strcmp(arg1, "icount") == 0) { | 458 if (strcmp(arg1, "icount") == 0) { |
| 459 const uint64_t icount = sim_->get_icount(); | 459 const uint64_t icount = sim_->get_icount(); |
| 460 OS::Print("icount: %"Pu64" 0x%"Px64"\n", icount, icount); | 460 OS::Print("icount: %" Pu64 " 0x%" Px64 "\n", icount, icount); |
| 461 } else if (GetValue(arg1, &value)) { | 461 } else if (GetValue(arg1, &value)) { |
| 462 OS::Print("%s: %u 0x%x\n", arg1, value, value); | 462 OS::Print("%s: %u 0x%x\n", arg1, value, value); |
| 463 } else { | 463 } else { |
| 464 OS::Print("%s unrecognized\n", arg1); | 464 OS::Print("%s unrecognized\n", arg1); |
| 465 } | 465 } |
| 466 } else { | 466 } else { |
| 467 OS::Print("print <reg or icount or value or *addr>\n"); | 467 OS::Print("print <reg or icount or value or *addr>\n"); |
| 468 } | 468 } |
| 469 } else if ((strcmp(cmd, "ps") == 0) || | 469 } else if ((strcmp(cmd, "ps") == 0) || |
| 470 (strcmp(cmd, "printsingle") == 0)) { | 470 (strcmp(cmd, "printsingle") == 0)) { |
| (...skipping 3401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3872 isolate->set_top_exit_frame_info(0); | 3872 isolate->set_top_exit_frame_info(0); |
| 3873 | 3873 |
| 3874 ASSERT(raw_exception != Object::null()); | 3874 ASSERT(raw_exception != Object::null()); |
| 3875 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3875 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
| 3876 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3876 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
| 3877 buf->Longjmp(); | 3877 buf->Longjmp(); |
| 3878 } | 3878 } |
| 3879 | 3879 |
| 3880 } // namespace dart | 3880 } // namespace dart |
| 3881 | 3881 |
| 3882 #endif // !defined(HOST_ARCH_ARM) | 3882 #endif // defined(USING_SIMULATOR) |
| 3883 | 3883 |
| 3884 #endif // defined TARGET_ARCH_ARM | 3884 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |