Skip to content

Commit 7b6d1d5

Browse files
committed
[lldb] Consult Language plugin in GetDisplayDemangledName (llvm#90294)
Give language plugins the opportunity to provide a language specific display name. This will be used in a follow up commit. The purpose of this change is to ultimately display breakpoint locations with a more human friendly demangling of Swift symbols. (cherry picked from commit b52160d)
1 parent 2af7c27 commit 7b6d1d5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lldb/include/lldb/Target/Language.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ class Language : public PluginInterface {
270270
return mangled.GetMangledName();
271271
}
272272

273+
virtual ConstString GetDisplayDemangledName(Mangled mangled) const {
274+
return mangled.GetDemangledName();
275+
}
276+
273277
virtual void GetExceptionResolverDescription(bool catch_on, bool throw_on,
274278
Stream &s);
275279

lldb/source/Core/Mangled.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ ConstString Mangled::GetDisplayDemangledName(
337337
m_mangled.GetStringRef(), SwiftLanguageRuntime::eSimplified, sc));
338338
#endif // LLDB_ENABLE_SWIFT
339339
// END SWIFT
340+
if (Language *lang = Language::FindPlugin(GuessLanguage()))
341+
return lang->GetDisplayDemangledName(*this);
340342
return GetDemangledName();
341343
}
342344

0 commit comments

Comments
 (0)