Skip to content

Commit e059b62

Browse files
committed
Fix two calls to GetSuggestedStackFrameIndex that weren't honoring
the inline_stack argument. This was causing the test failure in TestSwiftRuntimeInstrumentationRecognizer.py.
1 parent 44a4c47 commit e059b62

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lldb/source/Target/InstrumentationRuntimeStopInfo.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ InstrumentationRuntimeStopInfo::GetSuggestedStackFrameIndex(
4848
ThreadSP thread_sp = GetThread();
4949
if (!thread_sp)
5050
return std::nullopt;
51+
52+
StackFrameSP frame_sp = thread_sp->GetStackFrameAtIndex(0);
53+
if (!frame_sp)
54+
return {};
55+
if (!frame_sp->IsInlined() && inlined_stack)
56+
return {};
5157

5258
// Defensive upper-bound of when we stop walking up the frames in
5359
// case we somehow ended up looking at an infinite recursion.

lldb/source/Target/StopInfo.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,13 @@ class StopInfoBreakpoint : public StopInfo {
255255
ThreadSP thread_sp(m_thread_wp.lock());
256256
if (!thread_sp)
257257
return {};
258+
259+
StackFrameSP frame_sp = thread_sp->GetStackFrameAtIndex(0);
260+
if (!frame_sp)
261+
return {};
262+
if (!frame_sp->IsInlined() && inlined_stack)
263+
return {};
264+
258265
BreakpointSiteSP bp_site_sp(
259266
thread_sp->GetProcess()->GetBreakpointSiteList().FindByID(m_value));
260267
if (!bp_site_sp)

0 commit comments

Comments
 (0)