diff options
author | Jim Ingham <jingham@apple.com> | 2015-11-13 03:37:48 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2015-11-13 03:37:48 +0000 |
commit | a3f466b9e785ca8f6712904e408bda31c79ca1b0 (patch) | |
tree | 169df39599828218021021c669461e0916846c92 /lldb/source/Target/ThreadPlanStepRange.cpp | |
parent | b34115b7fe18880dafa0f660c1d55a88a60c9edf (diff) | |
download | bcm5719-llvm-a3f466b9e785ca8f6712904e408bda31c79ca1b0.tar.gz bcm5719-llvm-a3f466b9e785ca8f6712904e408bda31c79ca1b0.zip |
Fix commit 252963 to work around a bug on some platforms where they don't
correctly handle stepping over one breakpoint directly onto another breakpoint.
This isn't fixing that bug, but rather just changing 252963 to not use breakpoints
if it is only stepping one instruction.
llvm-svn: 253008
Diffstat (limited to 'lldb/source/Target/ThreadPlanStepRange.cpp')
-rw-r--r-- | lldb/source/Target/ThreadPlanStepRange.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp index 8ccbb97df8f..44c990a6130 100644 --- a/lldb/source/Target/ThreadPlanStepRange.cpp +++ b/lldb/source/Target/ThreadPlanStepRange.cpp @@ -389,13 +389,23 @@ ThreadPlanStepRange::SetNextBranchBreakpoint () // If we didn't find a branch, run to the end of the range. if (branch_index == UINT32_MAX) { - branch_index = instructions->GetSize() - 1; + uint32_t last_index = instructions->GetSize() - 1; + if (last_index - pc_index > 1) + { + InstructionSP last_inst = instructions->GetInstructionAtIndex(last_index); + size_t last_inst_size = last_inst->GetOpcode().GetByteSize(); + run_to_address = last_inst->GetAddress(); + run_to_address.Slide(last_inst_size); + } + } + else if (branch_index - pc_index > 1) + { + run_to_address = instructions->GetInstructionAtIndex(branch_index)->GetAddress(); } - if (branch_index - pc_index > 1) + if (run_to_address.IsValid()) { const bool is_internal = true; - run_to_address = instructions->GetInstructionAtIndex(branch_index)->GetAddress(); m_next_branch_bp_sp = GetTarget().CreateBreakpoint(run_to_address, is_internal, false); if (m_next_branch_bp_sp) { |