Skip to content

[lldb][Format] Fall back to old function.name-with-args if language frame format is emtpy #10982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lldb/source/Core/FormatEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,9 @@ static bool FormatFunctionNameForLanguage(Stream &s,
return false;

FormatEntity::Entry format = language_plugin->GetFunctionNameFormat();
if (!format)

// Bail on invalid or empty format.
if (!format || format == FormatEntity::Entry(Entry::Type::Root))
return false;

StreamString name_stream;
Expand Down
32 changes: 32 additions & 0 deletions lldb/test/Shell/Settings/TestCxxFrameFormatEmpty.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# XFAIL: target-windows

# Test that setting plugin.cplusplus.display.function-name-format
# to an empty string disables the "format by language" part of
# ${function.name-with-args}.

# RUN: split-file %s %t
# RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out
# RUN: %lldb -x -b -s %t/commands.input %t.out -o exit 2>&1 \
# RUN: | FileCheck %s

#--- main.cpp
namespace ns::ns2 {
void custom(int x) {}
void bar() { custom(5); }
}

int main(int argc, char const *argv[]) {
ns::ns2::bar();
return 0;
}

#--- commands.input
settings set plugin.cplusplus.display.function-name-format ""
settings set -f frame-format "custom-frame '${function.name-with-args}'\n"
break set -l 2 -f main.cpp

run
bt

# CHECK: custom-frame 'ns::ns2::custom(x=5)'
# CHECK: custom-frame 'ns::ns2::bar()'