aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/Shell/Settings/TestChildDepthTruncation.test
blob: b09f98ebd1a5a245fb2a62b335f49232ec9168aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Test that we warn the user about truncated output
# when target.max-children-depth wasn't explicitly set.

# RUN: split-file %s %t
# RUN: %clangxx_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 a;
    struct L2 {
        int b;
        struct L3 {
            int c;
            struct L4 {
                int d;
                struct L5 {
                    int e;
                    struct L6 {
                      int f;
                    } l6;
                } 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