|
| 1 | +# Test that we warn the user about truncated output |
| 2 | +# when target.max-children-depth wasn't explicitly set. |
| 3 | + |
| 4 | +# RUN: split-file %s %t |
| 5 | +# RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out |
| 6 | +# RUN: %lldb -x -b -s %t/dwim-commands.input %t.out -o exit 2>&1 \ |
| 7 | +# RUN: | FileCheck %s --check-prefix=DWIM |
| 8 | +# |
| 9 | +# RUN: %lldb -x -b -s %t/expr-commands.input %t.out -o exit 2>&1 \ |
| 10 | +# RUN: | FileCheck %s --check-prefix=EXPR |
| 11 | +# |
| 12 | +# RUN: %lldb -x -b -s %t/frame-var-commands.input %t.out -o exit 2>&1 \ |
| 13 | +# RUN: | FileCheck %s --check-prefix=VAR |
| 14 | +# |
| 15 | +# RUN: %lldb -x -b -s %t/with-setting-commands.input %t.out -o exit 2>&1 \ |
| 16 | +# RUN: | FileCheck %s --check-prefix=SETTING |
| 17 | + |
| 18 | +#--- main.cpp |
| 19 | + |
| 20 | +struct L1 { |
| 21 | + int w; |
| 22 | + struct L2 { |
| 23 | + int x; |
| 24 | + struct L3 { |
| 25 | + int y; |
| 26 | + struct L4 { |
| 27 | + int z; |
| 28 | + struct L5 { |
| 29 | + int a; |
| 30 | + } l5; |
| 31 | + } l4; |
| 32 | + } l3; |
| 33 | + } l2; |
| 34 | +}; |
| 35 | + |
| 36 | +int main() { |
| 37 | + L1 nested; |
| 38 | + __builtin_debugtrap(); |
| 39 | +} |
| 40 | + |
| 41 | +#--- dwim-commands.input |
| 42 | + |
| 43 | +run |
| 44 | +dwim-print nested |
| 45 | +frame variable nested |
| 46 | + |
| 47 | +DWIM: (lldb) dwim-print nested |
| 48 | +DWIM: *** Some of the displayed variables have a greater depth of members |
| 49 | +DWIM-SAME: use the --depth option to dwim-print |
| 50 | +DWIM: (lldb) frame variable nested |
| 51 | +DWIM-NOT: *** Some of the displayed variables have a greater depth of members |
| 52 | + |
| 53 | +#--- expr-commands.input |
| 54 | + |
| 55 | +run |
| 56 | +expression nested |
| 57 | +frame variable nested |
| 58 | + |
| 59 | +EXPR: (lldb) expression nested |
| 60 | +EXPR: *** Some of the displayed variables have a greater depth of members |
| 61 | +EXPR-SAME: use the --depth option to expression |
| 62 | +EXPR: (lldb) frame variable nested |
| 63 | +EXPR-NOT: *** Some of the displayed variables have a greater depth of members |
| 64 | + |
| 65 | +#--- frame-var-commands.input |
| 66 | + |
| 67 | +run |
| 68 | +frame variable nested |
| 69 | +frame variable nested |
| 70 | + |
| 71 | +VAR: (lldb) frame variable nested |
| 72 | +VAR: *** Some of the displayed variables have a greater depth of members |
| 73 | +VAR-SAME: use the --depth option to frame variable |
| 74 | +VAR: (lldb) frame variable nested |
| 75 | +VAR-NOT: *** Some of the displayed variables have a greater depth of members |
| 76 | + |
| 77 | +#--- with-setting-commands.input |
| 78 | + |
| 79 | +run |
| 80 | +settings set target.max-children-depth 1 |
| 81 | +frame variable nested |
| 82 | + |
| 83 | +SETTING: (lldb) frame variable nested |
| 84 | +SETTING-NOT: *** Some of the displayed variables have a greater depth of members |
0 commit comments