Skip to content

Commit 652a6fd

Browse files
authored
[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.
1 parent 0c04ef2 commit 652a6fd

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
@@ -153,7 +153,8 @@ LLDBMemoryReader::resolvePointerAsSymbol(swift::remote::RemoteAddress address) {
153153
auto mangledName = symbol->GetMangled().GetMangledName().GetStringRef();
154154
// MemoryReader requires this to be a Swift symbol. LLDB can also be
155155
// aware of local symbols, so avoid returning those.
156-
if (swift::Demangle::isSwiftSymbol(mangledName))
156+
using namespace swift::Demangle;
157+
if (isSwiftSymbol(mangledName) && !isOldFunctionTypeMangling(mangledName))
157158
return {{mangledName, 0}};
158159
}
159160

0 commit comments

Comments
 (0)