Skip to content

Commit

Permalink
[lldb] Consult Language plugin in GetDisplayDemangledName (#90294)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kastiglione authored May 8, 2024
1 parent b1da82a commit b52160d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lldb/include/lldb/Target/Language.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ class Language : public PluginInterface {
return mangled.GetMangledName();
}

virtual ConstString GetDisplayDemangledName(Mangled mangled) const {
return mangled.GetDemangledName();
}

virtual void GetExceptionResolverDescription(bool catch_on, bool throw_on,
Stream &s);

Expand Down
2 changes: 2 additions & 0 deletions lldb/source/Core/Mangled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ ConstString Mangled::GetDemangledName() const {
}

ConstString Mangled::GetDisplayDemangledName() const {
if (Language *lang = Language::FindPlugin(GuessLanguage()))
return lang->GetDisplayDemangledName(*this);
return GetDemangledName();
}

Expand Down

0 comments on commit b52160d

Please sign in to comment.