Skip to content

Commit b52160d

Browse files
authored
[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.
1 parent b1da82a commit b52160d

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
@@ -281,6 +281,10 @@ class Language : public PluginInterface {
281281
return mangled.GetMangledName();
282282
}
283283

284+
virtual ConstString GetDisplayDemangledName(Mangled mangled) const {
285+
return mangled.GetDemangledName();
286+
}
287+
284288
virtual void GetExceptionResolverDescription(bool catch_on, bool throw_on,
285289
Stream &s);
286290

lldb/source/Core/Mangled.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ ConstString Mangled::GetDemangledName() const {
310310
}
311311

312312
ConstString Mangled::GetDisplayDemangledName() const {
313+
if (Language *lang = Language::FindPlugin(GuessLanguage()))
314+
return lang->GetDisplayDemangledName(*this);
313315
return GetDemangledName();
314316
}
315317

0 commit comments

Comments
 (0)