From bd820bcdcb4b9f2d8450b12246ce2bdb414975ce Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Wed, 9 Jul 2025 10:26:42 -0700 Subject: [PATCH] [lldb] Override GetDereferencedType for TypeSystemSwift (cherry picked from commit feacb720737020830ca7b1b6c0b7294e12e9e5b5) --- lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.cpp | 8 ++++++++ lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.cpp b/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.cpp index 8ace6bc09d4d6..916b75bd8ca44 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.cpp @@ -16,6 +16,7 @@ #include "Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h" #include "lldb/Core/PluginManager.h" #include "lldb/Symbol/CompileUnit.h" +#include "llvm/Support/Error.h" #include #include @@ -207,6 +208,13 @@ bool TypeSystemSwift::GetPtrAuthAddressDiversity( return false; } +llvm::Expected TypeSystemSwift::GetDereferencedType( + lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, + std::string &deref_name, uint32_t &deref_byte_size, + int32_t &deref_byte_offset, ValueObject *valobj, uint64_t &language_flags) { + return llvm::createStringError("Swift types cannot be dereferenced"); +} + namespace llvm { llvm::raw_ostream & operator<<(llvm::raw_ostream &os, diff --git a/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.h b/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.h index d389fba4e8c86..75d04a6d3db6d 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.h +++ b/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.h @@ -350,6 +350,12 @@ class TypeSystemSwift : public TypeSystem { unsigned GetPtrAuthDiscriminator(lldb::opaque_compiler_type_t type) override; bool GetPtrAuthAddressDiversity(lldb::opaque_compiler_type_t type) override; + llvm::Expected + GetDereferencedType(lldb::opaque_compiler_type_t type, + ExecutionContext *exe_ctx, std::string &deref_name, + uint32_t &deref_byte_size, int32_t &deref_byte_offset, + ValueObject *valobj, uint64_t &language_flags) override; + /// \} protected: /// Used in the logs.