[Lldb-commits] [lldb] [lldb] Add SBFunction::GetBaseName() & SBSymbol::GetBaseName() (PR #155939)

via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 28 16:37:47 PDT 2025


================
@@ -287,6 +287,18 @@ class Mangled {
   /// Retrieve \c DemangledNameInfo of the demangled name held by this object.
   const std::optional<DemangledNameInfo> &GetDemangledInfo() const;
 
+  /// Compute the base name (without namespace/class qualifiers) from the
+  /// demangled name.
+  ///
+  /// For a demangled name like "ns::MyClass<int>::templateFunc", this returns
+  /// just "templateFunc". If the demangled name is not available or the
----------------
jimingham wrote:

I think if you can't compute the base name you should return an empty string.  After all, if I get the base name it's because I know that I can match that accurately, so you aren't doing me any favors by returning something I can't match accurately with no way of my knowing that.

https://github.com/llvm/llvm-project/pull/155939


More information about the lldb-commits mailing list