From 2a062d693693f92d80656cb2b334b7dc8e08121f Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Thu, 28 Aug 2025 19:10:52 -0700 Subject: [lldb] Add SBFunction::GetBaseName() & SBSymbol::GetBaseName() (#155939) When you are trying for instance to set a breakpoint on a function by name, but the SBFunction or SBSymbol are returning demangled names with argument lists, that match can be tedious to do. Internally, the base name of a symbol is something we handle all the time, so it's reasonable that there should be a way to get that info from the API as well. rdar://159318791 --- lldb/source/API/SBFunction.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lldb/source/API/SBFunction.cpp') diff --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp index 19861f6af364..65b02d6b309c 100644 --- a/lldb/source/API/SBFunction.cpp +++ b/lldb/source/API/SBFunction.cpp @@ -79,6 +79,15 @@ const char *SBFunction::GetMangledName() const { return nullptr; } +const char *SBFunction::GetBaseName() const { + LLDB_INSTRUMENT_VA(this); + + if (!m_opaque_ptr) + return nullptr; + + return m_opaque_ptr->GetMangled().GetBaseName().AsCString(); +} + bool SBFunction::operator==(const SBFunction &rhs) const { LLDB_INSTRUMENT_VA(this, rhs); -- cgit v1.2.3