Skip to content

Commit 7cfcec0

Browse files
committed
[lldb] Do not return old Swift mangled symbols from resolvePointerAsSymbol (#3967)
`isSwiftSymbol()` returns true for old Swift type mangling, which is any symbol starting with `"_T"`. This is unwanted, so the check is expanded to exclude regular symbols that happen to collide with the old prefix. (cherry picked from commit 652a6fd)
1 parent 54a3989 commit 7cfcec0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ LLDBMemoryReader::resolvePointerAsSymbol(swift::remote::RemoteAddress address) {
162162
auto mangledName = symbol->GetMangled().GetMangledName().GetStringRef();
163163
// MemoryReader requires this to be a Swift symbol. LLDB can also be
164164
// aware of local symbols, so avoid returning those.
165-
if (swift::Demangle::isSwiftSymbol(mangledName))
165+
using namespace swift::Demangle;
166+
if (isSwiftSymbol(mangledName) && !isOldFunctionTypeMangling(mangledName))
166167
return {{mangledName, 0}};
167168
}
168169

0 commit comments

Comments
 (0)