Skip to content

Commit 3e05e0b

Browse files
authoredJan 15, 2025
RemoteInspection: Append ResumeAsyncContext field to AsyncTaskInfo (#78645)
Expose a `Task`'s resume context via the `AsyncTaskInfo` struct. This will be used by lldb, but since this data is not specific to lldb it seems reasonable to include it generally.
1 parent 346704c commit 3e05e0b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎include/swift/RemoteInspection/ReflectionContext.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ class ReflectionContext
202202
StoredPointer AllocatorSlabPtr;
203203
std::vector<StoredPointer> ChildTasks;
204204
std::vector<StoredPointer> AsyncBacktraceFrames;
205+
StoredPointer ResumeAsyncContext;
205206
};
206207

207208
struct ActorInfo {
@@ -1825,9 +1826,12 @@ class ReflectionContext
18251826
RecordPtr = RecordObj->Parent;
18261827
}
18271828

1829+
const auto TaskResumeContext = AsyncTaskObj->ResumeContextAndReserved[0];
1830+
Info.ResumeAsyncContext = TaskResumeContext;
1831+
18281832
// Walk the async backtrace.
18291833
if (Info.HasIsRunning && !Info.IsRunning) {
1830-
auto ResumeContext = AsyncTaskObj->ResumeContextAndReserved[0];
1834+
auto ResumeContext = TaskResumeContext;
18311835
unsigned AsyncBacktraceLoopCount = 0;
18321836
while (ResumeContext && AsyncBacktraceLoopCount++ < AsyncBacktraceLimit) {
18331837
auto ResumeContextObj = readObj<AsyncContext<Runtime>>(ResumeContext);

0 commit comments

Comments
 (0)