Skip to content

Commit 67b573a

Browse files
authored
Merge pull request #10982 from swiftlang/lldb/empty-frame-format-to-6.2
2 parents 8a1d862 + 1e6af15 commit 67b573a

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

lldb/source/Core/FormatEntity.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,9 @@ static bool FormatFunctionNameForLanguage(Stream &s,
12821282
return false;
12831283

12841284
FormatEntity::Entry format = language_plugin->GetFunctionNameFormat();
1285-
if (!format)
1285+
1286+
// Bail on invalid or empty format.
1287+
if (!format || format == FormatEntity::Entry(Entry::Type::Root))
12861288
return false;
12871289

12881290
StreamString name_stream;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# XFAIL: target-windows
2+
3+
# Test that setting plugin.cplusplus.display.function-name-format
4+
# to an empty string disables the "format by language" part of
5+
# ${function.name-with-args}.
6+
7+
# RUN: split-file %s %t
8+
# RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out
9+
# RUN: %lldb -x -b -s %t/commands.input %t.out -o exit 2>&1 \
10+
# RUN: | FileCheck %s
11+
12+
#--- main.cpp
13+
namespace ns::ns2 {
14+
void custom(int x) {}
15+
void bar() { custom(5); }
16+
}
17+
18+
int main(int argc, char const *argv[]) {
19+
ns::ns2::bar();
20+
return 0;
21+
}
22+
23+
#--- commands.input
24+
settings set plugin.cplusplus.display.function-name-format ""
25+
settings set -f frame-format "custom-frame '${function.name-with-args}'\n"
26+
break set -l 2 -f main.cpp
27+
28+
run
29+
bt
30+
31+
# CHECK: custom-frame 'ns::ns2::custom(x=5)'
32+
# CHECK: custom-frame 'ns::ns2::bar()'

0 commit comments

Comments
 (0)