| 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 <math.h> // for isnan. | 5 #include <math.h> // for isnan. |
| 6 #include <setjmp.h> | 6 #include <setjmp.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #if defined(TARGET_ARCH_ARM) | 10 #if defined(TARGET_ARCH_ARM) |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 arg1[ARG_SIZE] = 0; | 414 arg1[ARG_SIZE] = 0; |
| 415 arg2[ARG_SIZE] = 0; | 415 arg2[ARG_SIZE] = 0; |
| 416 | 416 |
| 417 // Undo all set breakpoints while running in the debugger shell. This will | 417 // Undo all set breakpoints while running in the debugger shell. This will |
| 418 // make them invisible to all commands. | 418 // make them invisible to all commands. |
| 419 UndoBreakpoints(); | 419 UndoBreakpoints(); |
| 420 | 420 |
| 421 while (!done) { | 421 while (!done) { |
| 422 if (last_pc != sim_->get_pc()) { | 422 if (last_pc != sim_->get_pc()) { |
| 423 last_pc = sim_->get_pc(); | 423 last_pc = sim_->get_pc(); |
| 424 Disassembler::Disassemble(last_pc, last_pc + Instr::kInstrSize); | 424 if (Simulator::IsIllegalAddress(last_pc)) { |
| 425 OS::Print("pc is out of bounds: 0x%"Px"\n", last_pc); |
| 426 } else { |
| 427 Disassembler::Disassemble(last_pc, last_pc + Instr::kInstrSize); |
| 428 } |
| 425 } | 429 } |
| 426 char* line = ReadLine("sim> "); | 430 char* line = ReadLine("sim> "); |
| 427 if (line == NULL) { | 431 if (line == NULL) { |
| 428 FATAL("ReadLine failed"); | 432 FATAL("ReadLine failed"); |
| 429 } else { | 433 } else { |
| 430 // Use sscanf to parse the individual parts of the command line. At the | 434 // Use sscanf to parse the individual parts of the command line. At the |
| 431 // moment no command expects more than two parameters. | 435 // moment no command expects more than two parameters. |
| 432 int args = SScanF(line, | 436 int args = SScanF(line, |
| 433 "%" XSTR(COMMAND_SIZE) "s " | 437 "%" XSTR(COMMAND_SIZE) "s " |
| 434 "%" XSTR(ARG_SIZE) "s " | 438 "%" XSTR(ARG_SIZE) "s " |
| (...skipping 3195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3630 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3634 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
| 3631 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3635 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
| 3632 buf->Longjmp(); | 3636 buf->Longjmp(); |
| 3633 } | 3637 } |
| 3634 | 3638 |
| 3635 } // namespace dart | 3639 } // namespace dart |
| 3636 | 3640 |
| 3637 #endif // !defined(HOST_ARCH_ARM) | 3641 #endif // !defined(HOST_ARCH_ARM) |
| 3638 | 3642 |
| 3639 #endif // defined TARGET_ARCH_ARM | 3643 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |