Index: runtime/vm/debugger_arm64.cc |
diff --git a/runtime/vm/debugger_arm64.cc b/runtime/vm/debugger_arm64.cc |
index 12886438be39fe474e30543d63e5bd79da714969..43fec3efe5b5ae24d984d3612b7a4d1da7aa582c 100644 |
--- a/runtime/vm/debugger_arm64.cc |
+++ b/runtime/vm/debugger_arm64.cc |
@@ -53,15 +53,33 @@ void CodeBreakpoint::PatchCode() { |
WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size()); |
switch (breakpoint_kind_) { |
case PcDescriptors::kIcCall: |
- case PcDescriptors::kUnoptStaticCall: |
- case PcDescriptors::kRuntimeCall: |
+ case PcDescriptors::kUnoptStaticCall: { |
+ int32_t offset = CodePatcher::GetPoolOffsetAt(pc_); |
+ ASSERT((offset > 0) && ((offset & 0x7) == 0)); |
+ saved_value_ = static_cast<uword>(offset); |
+ const uint32_t stub_offset = |
+ InstructionPattern::OffsetFromPPIndex( |
+ Assembler::kICCallBreakpointCPIndex); |
+ CodePatcher::SetPoolOffsetAt(pc_, stub_offset); |
+ break; |
+ } |
case PcDescriptors::kClosureCall: { |
int32_t offset = CodePatcher::GetPoolOffsetAt(pc_); |
ASSERT((offset > 0) && ((offset & 0x7) == 0)); |
saved_value_ = static_cast<uword>(offset); |
const uint32_t stub_offset = |
InstructionPattern::OffsetFromPPIndex( |
- Assembler::kBreakpointRuntimeCPIndex); |
+ Assembler::kClosureCallBreakpointCPIndex); |
+ CodePatcher::SetPoolOffsetAt(pc_, stub_offset); |
+ break; |
+ } |
+ case PcDescriptors::kRuntimeCall: { |
+ int32_t offset = CodePatcher::GetPoolOffsetAt(pc_); |
+ ASSERT((offset > 0) && ((offset & 0x7) == 0)); |
+ saved_value_ = static_cast<uword>(offset); |
+ const uint32_t stub_offset = |
+ InstructionPattern::OffsetFromPPIndex( |
+ Assembler::kRuntimeCallBreakpointCPIndex); |
CodePatcher::SetPoolOffsetAt(pc_, stub_offset); |
break; |
} |