[Lldb-commits] [lldb] b52160d - [lldb] Consult Language plugin in GetDisplayDemangledName (#90294)
via lldb-commits
lldb-commits at lists.llvm.org
Wed May 8 13:07:10 PDT 2024
Author: Dave Lee
Date: 2024-05-08T13:07:07-07:00
New Revision: b52160dbae268cc87cb8f6cdf75553ca095e26a9
URL: https://github.com/llvm/llvm-project/commit/b52160dbae268cc87cb8f6cdf75553ca095e26a9
DIFF: https://github.com/llvm/llvm-project/commit/b52160dbae268cc87cb8f6cdf75553ca095e26a9.diff
LOG: [lldb] Consult Language plugin in GetDisplayDemangledName (#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.
Added:
Modified:
lldb/include/lldb/Target/Language.h
lldb/source/Core/Mangled.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Target/Language.h b/lldb/include/lldb/Target/Language.h
index 67714e6fdf942..ff7c60bf68bfc 100644
--- a/lldb/include/lldb/Target/Language.h
+++ b/lldb/include/lldb/Target/Language.h
@@ -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);
diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp
index b167c51fdce24..8efc4c639cca5 100644
--- a/lldb/source/Core/Mangled.cpp
+++ b/lldb/source/Core/Mangled.cpp
@@ -310,6 +310,8 @@ ConstString Mangled::GetDemangledName() const {
}
ConstString Mangled::GetDisplayDemangledName() const {
+ if (Language *lang = Language::FindPlugin(GuessLanguage()))
+ return lang->GetDisplayDemangledName(*this);
return GetDemangledName();
}
More information about the lldb-commits
mailing list