From 08581263dcff5c5fa6fa2e8d674a809554a35d1d Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Mon, 12 Mar 2018 21:17:04 +0000 Subject: Re-add change for https://reviews.llvm.org/D42582 with added directories. llvm-svn: 327331 --- lldb/source/Target/ThreadPlanStepInRange.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lldb/source/Target/ThreadPlanStepInRange.cpp') diff --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp index 6c5a9954f23f..015c784ff4b0 100644 --- a/lldb/source/Target/ThreadPlanStepInRange.cpp +++ b/lldb/source/Target/ThreadPlanStepInRange.cpp @@ -12,11 +12,13 @@ // Other libraries and framework includes // Project includes #include "lldb/Target/ThreadPlanStepInRange.h" +#include "lldb/Core/Architecture.h" #include "lldb/Core/Module.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" +#include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlanStepOut.h" @@ -277,6 +279,17 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) { bytes_to_skip = sc.symbol->GetPrologueByteSize(); } + if (bytes_to_skip == 0 && sc.symbol) { + TargetSP target = m_thread.CalculateTarget(); + Architecture *arch = target->GetArchitecturePlugin(); + if (arch) { + Address curr_sec_addr; + target->GetSectionLoadList().ResolveLoadAddress(curr_addr, + curr_sec_addr); + bytes_to_skip = arch->GetBytesToSkip(*sc.symbol, curr_sec_addr); + } + } + if (bytes_to_skip != 0) { func_start_address.Slide(bytes_to_skip); log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP); -- cgit v1.2.3