Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Unified Diff: runtime/vm/simulator_arm.cc

Issue 1097413004: Use a breakpoint instruction for a stop message on arm instead of (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/disassembler_mips.cc ('k') | runtime/vm/simulator_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_arm.cc
===================================================================
--- runtime/vm/simulator_arm.cc (revision 45360)
+++ runtime/vm/simulator_arm.cc (working copy)
@@ -1506,7 +1506,7 @@
void Simulator::SupervisorCall(Instr* instr) {
int svc = instr->SvcField();
switch (svc) {
- case kRedirectionSvcCode: {
+ case Instr::kSimulatorRedirectCode: {
SimulatorSetjmpBuffer buffer(this);
if (!setjmp(buffer.buffer_)) {
@@ -1627,19 +1627,11 @@
break;
}
- case kBreakpointSvcCode: {
+ case Instr::kSimulatorBreakCode: {
SimulatorDebugger dbg(this);
dbg.Stop(instr, "breakpoint");
break;
}
- case kStopMessageSvcCode: {
- SimulatorDebugger dbg(this);
- const char* message = *reinterpret_cast<const char**>(
- reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
- set_pc(get_pc() + Instr::kInstrSize);
- dbg.Stop(instr, message);
- break;
- }
default: {
UNREACHABLE();
break;
@@ -1696,10 +1688,18 @@
if ((instr->Bits(21, 2) == 0x1) && (instr->ConditionField() == AL)) {
// Format(instr, "bkpt #'imm12_4");
SimulatorDebugger dbg(this);
- set_pc(get_pc() + Instr::kInstrSize);
- char buffer[32];
- snprintf(buffer, sizeof(buffer), "bkpt #0x%x", instr->BkptField());
- dbg.Stop(instr, buffer);
+ int32_t imm = instr->BkptField();
+ if (imm == Instr::kStopMessageCode) {
+ const char* message = *reinterpret_cast<const char**>(
+ reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
+ set_pc(get_pc() + Instr::kInstrSize);
+ dbg.Stop(instr, message);
+ } else {
+ char buffer[32];
+ snprintf(buffer, sizeof(buffer), "bkpt #0x%x", imm);
+ set_pc(get_pc() + Instr::kInstrSize);
+ dbg.Stop(instr, buffer);
+ }
} else {
// Format(instr, "smc'cond");
UnimplementedInstruction(instr);
« no previous file with comments | « runtime/vm/disassembler_mips.cc ('k') | runtime/vm/simulator_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698