diff options
author | Michael Buch <michaelbuch12@gmail.com> | 2025-04-29 07:13:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-29 07:13:04 +0100 |
commit | da7099290cea7d11b83da01adda8afeb3bcd5362 (patch) | |
tree | f76513fe1d03f8b89695016baeb9b98909f1029d /lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp | |
parent | 0ddb5794b7b47481ed713af0add392de324d5cd2 (diff) | |
download | llvm-da7099290cea7d11b83da01adda8afeb3bcd5362.zip llvm-da7099290cea7d11b83da01adda8afeb3bcd5362.tar.gz llvm-da7099290cea7d11b83da01adda8afeb3bcd5362.tar.bz2 |
Revert "[lldb][Format] Make function name frame-format variables work without debug-info" (#137757)
Reverts llvm/llvm-project#137408
This change broke `lldb/test/Shell/Unwind/split-machine-functions.test`.
The test binary has a symbol named `_Z3foov.cold` and the test expects
the backtrace to print the name of the cold part of the function like
this:
```
# SPLIT: frame #1: {{.*}}`foo() (.cold) +
```
but now it gets
```
frame #1: 0x000055555555514f split-machine-functions.test.tmp`foo() + 12
```
Diffstat (limited to 'lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp')
-rw-r--r-- | lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index ab8e9883..283e867 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -381,34 +381,6 @@ GetDemangledScope(const SymbolContext &sc) { return demangled_name.slice(info->ScopeRange.first, info->ScopeRange.second); } -static bool PrintDemangledArgumentList(Stream &s, const SymbolContext &sc) { - assert(sc.symbol); - - Mangled mangled = sc.GetPossiblyInlinedFunctionName(); - if (!mangled) - return false; - - auto demangled_name = mangled.GetDemangledName().GetStringRef(); - if (demangled_name.empty()) - return false; - - const std::optional<DemangledNameInfo> &info = mangled.GetDemangledInfo(); - if (!info) - return false; - - // Function without a basename is nonsense. - if (!info->hasBasename()) - return false; - - if (info->ArgumentsRange.second < info->ArgumentsRange.first) - return false; - - s << demangled_name.slice(info->ArgumentsRange.first, - info->ArgumentsRange.second); - - return true; -} - bool CPlusPlusLanguage::CxxMethodName::TrySimplifiedParse() { // This method tries to parse simple method definitions which are presumably // most comman in user programs. Definitions that can be parsed by this @@ -1918,6 +1890,8 @@ bool CPlusPlusLanguage::GetFunctionDisplayName( bool CPlusPlusLanguage::HandleFrameFormatVariable( const SymbolContext &sc, const ExecutionContext *exe_ctx, FormatEntity::Entry::Type type, Stream &s) { + assert(sc.function); + switch (type) { case FormatEntity::Entry::Type::FunctionScope: { std::optional<llvm::StringRef> scope = GetDemangledScope(sc); @@ -1951,14 +1925,6 @@ bool CPlusPlusLanguage::HandleFrameFormatVariable( } case FormatEntity::Entry::Type::FunctionFormattedArguments: { - // This ensures we print the arguments even when no debug-info is available. - // - // FIXME: we should have a Entry::Type::FunctionArguments and - // use it in the plugin.cplusplus.display.function-name-format - // once we have a "fallback operator" in the frame-format language. - if (!sc.function && sc.symbol) - return PrintDemangledArgumentList(s, sc); - VariableList args; if (auto variable_list_sp = GetFunctionVariableList(sc)) variable_list_sp->AppendVariablesWithScope(eValueTypeVariableArgument, |