Skip to content

Commit 845de1c

Browse files
committed
separately handle tagged and real addresses
1 parent 23b2a50 commit 845de1c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,19 @@ LLDBMemoryReader::resolvePointer(swift::remote::RemoteAddress address,
135135

136136
llvm::Optional<Address> maybeAddr =
137137
resolveRemoteAddress(address.getAddressData());
138+
// This is not an assert, but should never happen.
138139
if (!maybeAddr)
139140
return pointer;
140-
auto addr = *maybeAddr;
141+
142+
Address addr;
143+
if (maybeAddr->IsSectionOffset()) {
144+
// `address` was tagged, and then successfully mapped (resolved).
145+
addr = *maybeAddr;
146+
} else {
147+
// `address` is a real load address.
148+
if (!target.ResolveLoadAddress(address.getAddressData(), addr))
149+
return pointer;
150+
}
141151

142152
if (!addr.GetSection()->CanContainSwiftReflectionData())
143153
return pointer;

0 commit comments

Comments
 (0)