summaryrefslogtreecommitdiff
path: root/lldb/test/Shell/Settings
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/Shell/Settings')
-rw-r--r--lldb/test/Shell/Settings/TestChildCountTruncation.test68
-rw-r--r--lldb/test/Shell/Settings/TestChildDepthTruncation.test84
-rw-r--r--lldb/test/Shell/Settings/TestCxxFrameFormatEmpty.test32
3 files changed, 184 insertions, 0 deletions
diff --git a/lldb/test/Shell/Settings/TestChildCountTruncation.test b/lldb/test/Shell/Settings/TestChildCountTruncation.test
new file mode 100644
index 000000000000..da6436cb5ca2
--- /dev/null
+++ b/lldb/test/Shell/Settings/TestChildCountTruncation.test
@@ -0,0 +1,68 @@
+# Test that we warn the user about truncated output
+# when target.max-children-count wasn't explicitly set.
+
+# RUN: split-file %s %t
+# RUN: %clang_host -g %t/main.cpp -o %t.out
+# RUN: %lldb -x -b -s %t/dwim-commands.input %t.out -o exit 2>&1 \
+# RUN: | FileCheck %s --check-prefix=DWIM
+#
+# RUN: %lldb -x -b -s %t/expr-commands.input %t.out -o exit 2>&1 \
+# RUN: | FileCheck %s --check-prefix=EXPR
+#
+# RUN: %lldb -x -b -s %t/frame-var-commands.input %t.out -o exit 2>&1 \
+# RUN: | FileCheck %s --check-prefix=VAR
+#
+# RUN: %lldb -x -b -s %t/with-setting-commands.input %t.out -o exit 2>&1 \
+# RUN: | FileCheck %s --check-prefix=SETTING
+
+#--- main.cpp
+
+int main() {
+ int arr[512] = { 3 };
+ __builtin_debugtrap();
+}
+
+#--- dwim-commands.input
+
+run
+dwim-print arr
+frame variable arr
+
+DWIM: (lldb) dwim-print arr
+DWIM: *** Some of the displayed variables have more members
+DWIM-SAME: use the --show-all-children option to dwim-print
+DWIM: (lldb) frame variable arr
+DWIM-NOT: *** Some of the displayed variables have more members
+
+#--- expr-commands.input
+
+run
+expression arr
+frame variable arr
+
+EXPR: (lldb) expression arr
+EXPR: *** Some of the displayed variables have more members
+EXPR-SAME: use the --show-all-children option to expression
+EXPR: (lldb) frame variable arr
+EXPR-NOT: *** Some of the displayed variables have more members
+
+#--- frame-var-commands.input
+
+run
+frame variable arr
+dwim-print arr
+
+VAR: (lldb) frame variable arr
+VAR: *** Some of the displayed variables have more members
+VAR-SAME: use the --show-all-children option to frame variable
+VAR: (lldb) dwim-print arr
+VAR-NOT: *** Some of the displayed variables have more members
+
+#--- with-setting-commands.input
+
+run
+settings set target.max-children-count 1
+frame variable arr
+
+SETTING: (lldb) frame variable arr
+SETTING-NOT: *** Some of the displayed variables have more members
diff --git a/lldb/test/Shell/Settings/TestChildDepthTruncation.test b/lldb/test/Shell/Settings/TestChildDepthTruncation.test
new file mode 100644
index 000000000000..12f5661600ae
--- /dev/null
+++ b/lldb/test/Shell/Settings/TestChildDepthTruncation.test
@@ -0,0 +1,84 @@
+# Test that we warn the user about truncated output
+# when target.max-children-depth wasn't explicitly set.
+
+# RUN: split-file %s %t
+# RUN: %clang_host -g %t/main.cpp -o %t.out
+# RUN: %lldb -x -b -s %t/dwim-commands.input %t.out -o exit 2>&1 \
+# RUN: | FileCheck %s --check-prefix=DWIM
+#
+# RUN: %lldb -x -b -s %t/expr-commands.input %t.out -o exit 2>&1 \
+# RUN: | FileCheck %s --check-prefix=EXPR
+#
+# RUN: %lldb -x -b -s %t/frame-var-commands.input %t.out -o exit 2>&1 \
+# RUN: | FileCheck %s --check-prefix=VAR
+#
+# RUN: %lldb -x -b -s %t/with-setting-commands.input %t.out -o exit 2>&1 \
+# RUN: | FileCheck %s --check-prefix=SETTING
+
+#--- main.cpp
+
+struct L1 {
+ int w;
+ struct L2 {
+ int x;
+ struct L3 {
+ int y;
+ struct L4 {
+ int z;
+ struct L5 {
+ int a;
+ } l5;
+ } l4;
+ } l3;
+ } l2;
+};
+
+int main() {
+ L1 nested;
+ __builtin_debugtrap();
+}
+
+#--- dwim-commands.input
+
+run
+dwim-print nested
+frame variable nested
+
+DWIM: (lldb) dwim-print nested
+DWIM: *** Some of the displayed variables have a greater depth of members
+DWIM-SAME: use the --depth option to dwim-print
+DWIM: (lldb) frame variable nested
+DWIM-NOT: *** Some of the displayed variables have a greater depth of members
+
+#--- expr-commands.input
+
+run
+expression nested
+frame variable nested
+
+EXPR: (lldb) expression nested
+EXPR: *** Some of the displayed variables have a greater depth of members
+EXPR-SAME: use the --depth option to expression
+EXPR: (lldb) frame variable nested
+EXPR-NOT: *** Some of the displayed variables have a greater depth of members
+
+#--- frame-var-commands.input
+
+run
+frame variable nested
+frame variable nested
+
+VAR: (lldb) frame variable nested
+VAR: *** Some of the displayed variables have a greater depth of members
+VAR-SAME: use the --depth option to frame variable
+VAR: (lldb) frame variable nested
+VAR-NOT: *** Some of the displayed variables have a greater depth of members
+
+#--- with-setting-commands.input
+
+run
+settings set target.max-children-depth 1
+frame variable nested
+
+SETTING: (lldb) frame variable nested
+SETTING-NOT: *** Some of the displayed variables have a greater depth of members
diff --git a/lldb/test/Shell/Settings/TestCxxFrameFormatEmpty.test b/lldb/test/Shell/Settings/TestCxxFrameFormatEmpty.test
new file mode 100644
index 000000000000..0a6d2723ded3
--- /dev/null
+++ b/lldb/test/Shell/Settings/TestCxxFrameFormatEmpty.test
@@ -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()'