Skip to content

Commit 79f5549

Browse files
author
git apple-llvm automerger
committed
Merge commit '38a3fc37c5f5' from swift/release/6.1 into stable/20240723
2 parents 70424a2 + 38a3fc3 commit 79f5549

File tree

10 files changed

+0
-306
lines changed

10 files changed

+0
-306
lines changed

lldb/source/Plugins/Language/Swift/SwiftFormatters.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "Plugins/Language/Swift/SwiftStringIndex.h"
1515
#include "Plugins/LanguageRuntime/Swift/ReflectionContextInterface.h"
1616
#include "Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h"
17-
#include "Plugins/LanguageRuntime/Swift/SwiftTask.h"
1817
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1918
#include "lldb/DataFormatters/FormattersHelpers.h"
2019
#include "lldb/DataFormatters/StringPrinter.h"
@@ -24,7 +23,6 @@
2423
#include "lldb/Utility/LLDBLog.h"
2524
#include "lldb/Utility/Log.h"
2625
#include "lldb/Utility/Status.h"
27-
#include "lldb/Utility/StreamString.h"
2826
#include "lldb/Utility/Timer.h"
2927
#include "lldb/ValueObject/ValueObject.h"
3028
#include "lldb/lldb-enumerations.h"

lldb/source/Plugins/LanguageRuntime/Swift/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ add_lldb_library(lldbPluginSwiftLanguageRuntime PLUGIN
66
SwiftLanguageRuntimeNames.cpp
77
SwiftLanguageRuntimeRemoteAST.cpp
88
SwiftMetadataCache.cpp
9-
SwiftTask.cpp
109

1110
LINK_LIBS
1211
swiftAST

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,6 @@ class TargetReflectionContext : public ReflectionContextInterface {
401401
result.hasIsRunning = task_info.HasIsRunning;
402402
result.isRunning = task_info.IsRunning;
403403
result.isEnqueued = task_info.IsEnqueued;
404-
result.id = task_info.Id;
405-
result.resumeAsyncContext = task_info.ResumeAsyncContext;
406404
return result;
407405
}
408406

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#include <mutex>
1717

18-
#include "lldb/lldb-defines.h"
1918
#include "lldb/lldb-types.h"
2019
#include "swift/ABI/ObjectFile.h"
2120
#include "swift/Remote/RemoteAddress.h"
@@ -164,8 +163,6 @@ class ReflectionContextInterface {
164163
bool hasIsRunning = false;
165164
bool isRunning = false;
166165
bool isEnqueued = false;
167-
uint64_t id = 0;
168-
lldb::addr_t resumeAsyncContext = LLDB_INVALID_ADDRESS;
169166
};
170167
// The default limits are copied from swift-inspect.
171168
virtual llvm::Expected<AsyncTaskInfo>

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

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "SwiftMetadataCache.h"
1717

1818
#include "Plugins/ExpressionParser/Swift/SwiftPersistentExpressionState.h"
19-
#include "Plugins/LanguageRuntime/Swift/SwiftTask.h"
2019
#include "Plugins/Process/Utility/RegisterContext_x86.h"
2120
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
2221
#include "Plugins/TypeSystem/Swift/SwiftDemangle.h"
@@ -2086,89 +2085,6 @@ class CommandObjectSwift_RefCount : public CommandObjectRaw {
20862085
}
20872086
};
20882087

2089-
class CommandObjectLanguageSwiftTaskBacktrace final
2090-
: public CommandObjectParsed {
2091-
public:
2092-
CommandObjectLanguageSwiftTaskBacktrace(CommandInterpreter &interpreter)
2093-
: CommandObjectParsed(interpreter, "backtrace",
2094-
"Show the backtrace of Swift tasks. See `thread "
2095-
"backtrace` for customizing backtrace output.",
2096-
"language swift task backtrace <variable-name>") {
2097-
AddSimpleArgumentList(eArgTypeVarName);
2098-
}
2099-
2100-
private:
2101-
void DoExecute(Args &command, CommandReturnObject &result) override {
2102-
if (!m_exe_ctx.GetFramePtr()) {
2103-
result.AppendError("no active frame selected");
2104-
return;
2105-
}
2106-
2107-
if (command.empty() || command[0].ref().empty()) {
2108-
result.AppendError("no task variable");
2109-
return;
2110-
}
2111-
2112-
StackFrame &frame = m_exe_ctx.GetFrameRef();
2113-
uint32_t path_options =
2114-
StackFrame::eExpressionPathOptionsAllowDirectIVarAccess;
2115-
VariableSP var_sp;
2116-
Status status;
2117-
ValueObjectSP valobj_sp = frame.GetValueForVariableExpressionPath(
2118-
command[0].c_str(), eDynamicDontRunTarget, path_options, var_sp,
2119-
status);
2120-
if (!valobj_sp) {
2121-
result.AppendError(status.AsCString());
2122-
return;
2123-
}
2124-
2125-
addr_t task_ptr = LLDB_INVALID_ADDRESS;
2126-
ThreadSafeReflectionContext reflection_ctx;
2127-
if (ValueObjectSP task_obj_sp =
2128-
valobj_sp->GetChildMemberWithName("_task")) {
2129-
task_ptr = task_obj_sp->GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
2130-
if (task_ptr != LLDB_INVALID_ADDRESS)
2131-
if (auto *runtime = SwiftLanguageRuntime::Get(m_exe_ctx.GetProcessSP()))
2132-
reflection_ctx = runtime->GetReflectionContext();
2133-
}
2134-
if (task_ptr == LLDB_INVALID_ADDRESS || !reflection_ctx) {
2135-
result.AppendError("failed to access Task data from runtime");
2136-
return;
2137-
}
2138-
2139-
llvm::Expected<ReflectionContextInterface::AsyncTaskInfo> task_info =
2140-
reflection_ctx->asyncTaskInfo(task_ptr);
2141-
if (auto error = task_info.takeError()) {
2142-
result.AppendError(toString(std::move(error)));
2143-
return;
2144-
}
2145-
2146-
auto thread_task = ThreadTask::Create(
2147-
task_info->id, task_info->resumeAsyncContext, m_exe_ctx);
2148-
if (auto error = thread_task.takeError()) {
2149-
result.AppendError(toString(std::move(error)));
2150-
return;
2151-
}
2152-
2153-
// GetStatus prints the backtrace.
2154-
thread_task.get()->GetStatus(result.GetOutputStream(), 0, UINT32_MAX, 0,
2155-
false, true);
2156-
result.SetStatus(lldb::eReturnStatusSuccessFinishResult);
2157-
}
2158-
};
2159-
2160-
class CommandObjectLanguageSwiftTask final : public CommandObjectMultiword {
2161-
public:
2162-
CommandObjectLanguageSwiftTask(CommandInterpreter &interpreter)
2163-
: CommandObjectMultiword(
2164-
interpreter, "task", "Commands for inspecting Swift Tasks.",
2165-
"language swift task <subcommand> [<subcommand-options>]") {
2166-
LoadSubCommand("backtrace",
2167-
CommandObjectSP(new CommandObjectLanguageSwiftTaskBacktrace(
2168-
interpreter)));
2169-
}
2170-
};
2171-
21722088
class CommandObjectMultiwordSwift : public CommandObjectMultiword {
21732089
public:
21742090
CommandObjectMultiwordSwift(CommandInterpreter &interpreter)
@@ -2180,8 +2096,6 @@ class CommandObjectMultiwordSwift : public CommandObjectMultiword {
21802096
interpreter)));
21812097
LoadSubCommand("refcount", CommandObjectSP(new CommandObjectSwift_RefCount(
21822098
interpreter)));
2183-
LoadSubCommand("task", CommandObjectSP(new CommandObjectLanguageSwiftTask(
2184-
interpreter)));
21852099
}
21862100

21872101
virtual ~CommandObjectMultiwordSwift() {}

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

Lines changed: 0 additions & 74 deletions
This file was deleted.

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

Lines changed: 0 additions & 97 deletions
This file was deleted.

lldb/test/API/lang/swift/async/tasks/Makefile

Lines changed: 0 additions & 3 deletions
This file was deleted.

lldb/test/API/lang/swift/async/tasks/TestSwiftTaskBacktrace.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

lldb/test/API/lang/swift/async/tasks/main.swift

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)