Skip to content

[next][lldb] Override GetDereferencedType for TypeSystemSwift #11043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <lldb/lldb-enumerations.h>
#include <llvm/ADT/StringRef.h>

Expand Down Expand Up @@ -207,6 +208,13 @@ bool TypeSystemSwift::GetPtrAuthAddressDiversity(
return false;
}

llvm::Expected<CompilerType> 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,
Expand Down
6 changes: 6 additions & 0 deletions lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<CompilerType>
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.
Expand Down