Skip to content

Commit bffca2b

Browse files
[LLDB][swift][nfc] Make unwind method a member
This will enable subsequent commits to introduce calls to other member functions from that method.
1 parent 2672795 commit bffca2b

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ static bool IsModuleSwiftRuntime(lldb_private::Process &process,
9999
return module.GetFileSpec().GetFilename() == GetStandardLibraryName(process);
100100
}
101101

102-
static UnwindPlanSP
103-
GetFollowAsyncContextUnwindPlan(RegisterContext *regctx, ArchSpec &arch,
104-
bool &behaves_like_zeroth_frame);
105-
106102
AppleObjCRuntimeV2 *
107103
SwiftLanguageRuntime::GetObjCRuntime(lldb_private::Process &process) {
108104
if (auto objc_runtime = ObjCLanguageRuntime::Get(process)) {
@@ -2608,7 +2604,7 @@ SwiftLanguageRuntime::GetRuntimeUnwindPlan(ProcessSP process_sp,
26082604
addr_t fp = regctx->GetFP(LLDB_INVALID_ADDRESS);
26092605
if (fp == LLDB_INVALID_ADDRESS) {
26102606
if (GetAsyncContext(regctx) != LLDB_INVALID_ADDRESS)
2611-
return GetFollowAsyncContextUnwindPlan(regctx, arch,
2607+
return GetFollowAsyncContextUnwindPlan(process_sp, regctx, arch,
26122608
behaves_like_zeroth_frame);
26132609
return UnwindPlanSP();
26142610
}
@@ -2763,11 +2759,9 @@ SwiftLanguageRuntime::GetRuntimeUnwindPlan(ProcessSP process_sp,
27632759
return plan;
27642760
}
27652761

2766-
// Creates an UnwindPlan for following the AsyncContext chain
2767-
// up the stack, from a current AsyncContext frame.
2768-
static UnwindPlanSP
2769-
GetFollowAsyncContextUnwindPlan(RegisterContext *regctx, ArchSpec &arch,
2770-
bool &behaves_like_zeroth_frame) {
2762+
UnwindPlanSP SwiftLanguageRuntime::GetFollowAsyncContextUnwindPlan(
2763+
ProcessSP process_sp, RegisterContext *regctx, ArchSpec &arch,
2764+
bool &behaves_like_zeroth_frame) {
27712765
LLDB_SCOPED_TIMER();
27722766

27732767
UnwindPlan::RowSP row(new UnwindPlan::Row);

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,14 @@ class SwiftLanguageRuntime : public LanguageRuntime {
482482
bool GetTargetOfPartialApply(SymbolContext &curr_sc, ConstString &apply_name,
483483
SymbolContext &sc);
484484
AppleObjCRuntimeV2 *GetObjCRuntime();
485+
486+
private:
487+
/// Creates an UnwindPlan for following the AsyncContext chain up the stack,
488+
/// from a current AsyncContext frame.
489+
lldb::UnwindPlanSP
490+
GetFollowAsyncContextUnwindPlan(lldb::ProcessSP process_sp,
491+
RegisterContext *regctx, ArchSpec &arch,
492+
bool &behaves_like_zeroth_frame);
485493
};
486494

487495
} // namespace lldb_private

0 commit comments

Comments
 (0)