| 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_MIPS) | 9 #if defined(TARGET_ARCH_MIPS) |
| 10 | 10 |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 } else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) { | 462 } else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) { |
| 463 // Execute the one instruction we broke at with breakpoints disabled. | 463 // Execute the one instruction we broke at with breakpoints disabled. |
| 464 sim_->InstructionDecode(reinterpret_cast<Instr*>(sim_->get_pc())); | 464 sim_->InstructionDecode(reinterpret_cast<Instr*>(sim_->get_pc())); |
| 465 // Leave the debugger shell. | 465 // Leave the debugger shell. |
| 466 done = true; | 466 done = true; |
| 467 } else if ((strcmp(cmd, "p") == 0) || (strcmp(cmd, "print") == 0)) { | 467 } else if ((strcmp(cmd, "p") == 0) || (strcmp(cmd, "print") == 0)) { |
| 468 if (args == 2) { | 468 if (args == 2) { |
| 469 uint32_t value; | 469 uint32_t value; |
| 470 if (strcmp(arg1, "icount") == 0) { | 470 if (strcmp(arg1, "icount") == 0) { |
| 471 const uint64_t icount = sim_->get_icount(); | 471 const uint64_t icount = sim_->get_icount(); |
| 472 OS::Print("icount: %"Pu64" 0x%"Px64"\n", icount, icount); | 472 OS::Print("icount: %" Pu64 " 0x%" Px64 "\n", icount, icount); |
| 473 } else if (GetValue(arg1, &value)) { | 473 } else if (GetValue(arg1, &value)) { |
| 474 OS::Print("%s: %u 0x%x\n", arg1, value, value); | 474 OS::Print("%s: %u 0x%x\n", arg1, value, value); |
| 475 } else { | 475 } else { |
| 476 OS::Print("%s unrecognized\n", arg1); | 476 OS::Print("%s unrecognized\n", arg1); |
| 477 } | 477 } |
| 478 } else { | 478 } else { |
| 479 OS::Print("print <reg or icount or value or *addr>\n"); | 479 OS::Print("print <reg or icount or value or *addr>\n"); |
| 480 } | 480 } |
| 481 } else if ((strcmp(cmd, "pf") == 0) || | 481 } else if ((strcmp(cmd, "pf") == 0) || |
| 482 (strcmp(cmd, "printfloat") == 0)) { | 482 (strcmp(cmd, "printfloat") == 0)) { |
| (...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1978 UnimplementedInstruction(instr); | 1978 UnimplementedInstruction(instr); |
| 1979 break; | 1979 break; |
| 1980 } | 1980 } |
| 1981 } | 1981 } |
| 1982 } | 1982 } |
| 1983 } | 1983 } |
| 1984 | 1984 |
| 1985 | 1985 |
| 1986 void Simulator::InstructionDecode(Instr* instr) { | 1986 void Simulator::InstructionDecode(Instr* instr) { |
| 1987 if (IsTracingExecution()) { | 1987 if (IsTracingExecution()) { |
| 1988 OS::Print("%"Pu64, icount_); | 1988 OS::Print("%" Pu64, icount_); |
| 1989 const uword start = reinterpret_cast<uword>(instr); | 1989 const uword start = reinterpret_cast<uword>(instr); |
| 1990 const uword end = start + Instr::kInstrSize; | 1990 const uword end = start + Instr::kInstrSize; |
| 1991 Disassembler::Disassemble(start, end); | 1991 Disassembler::Disassemble(start, end); |
| 1992 } | 1992 } |
| 1993 | 1993 |
| 1994 switch (instr->OpcodeField()) { | 1994 switch (instr->OpcodeField()) { |
| 1995 case SPECIAL: { | 1995 case SPECIAL: { |
| 1996 DecodeSpecial(instr); | 1996 DecodeSpecial(instr); |
| 1997 break; | 1997 break; |
| 1998 } | 1998 } |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2494 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 2494 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
| 2495 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 2495 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
| 2496 buf->Longjmp(); | 2496 buf->Longjmp(); |
| 2497 } | 2497 } |
| 2498 | 2498 |
| 2499 } // namespace dart | 2499 } // namespace dart |
| 2500 | 2500 |
| 2501 #endif // !defined(HOST_ARCH_MIPS) | 2501 #endif // !defined(HOST_ARCH_MIPS) |
| 2502 | 2502 |
| 2503 #endif // defined TARGET_ARCH_MIPS | 2503 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |