Commit | Line | Data |
---|---|---|
3666a048 | 1 | # Copyright (C) 2018-2021 Free Software Foundation, Inc. |
5abe0f0c JV |
2 | # This program is free software; you can redistribute it and/or modify |
3 | # it under the terms of the GNU General Public License as published by | |
4 | # the Free Software Foundation; either version 3 of the License, or | |
5 | # (at your option) any later version. | |
6 | # | |
7 | # This program is distributed in the hope that it will be useful, | |
8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
10 | # GNU General Public License for more details. | |
11 | # | |
12 | # You should have received a copy of the GNU General Public License | |
13 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
14 | ||
15 | # Tests whether -var-info-path-expression fails as documented when | |
16 | # invoked on a dynamic varobj. | |
17 | ||
18 | load_lib mi-support.exp | |
19 | set MIFLAGS "-i=mi" | |
20 | ||
5abe0f0c JV |
21 | # |
22 | # Start here | |
23 | # | |
24 | standard_testfile | |
25 | ||
26 | if {[gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable {debug}] != "" } { | |
27 | return -1 | |
28 | } | |
29 | ||
b75d55d4 PA |
30 | mi_clean_restart $binfile |
31 | ||
e7fe496b TV |
32 | # Skip all tests if Python scripting is not enabled. |
33 | if { [mi_skip_python_tests] } { continue } | |
34 | ||
74c2c1f4 SL |
35 | set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py] |
36 | mi_gdb_test "source ${pyfile}" \ | |
5abe0f0c JV |
37 | ".*\\^done" \ |
38 | "load python file" | |
39 | ||
40 | mi_gdb_test "-enable-pretty-printing" \ | |
41 | "\\^done" \ | |
42 | "-enable-pretty-printing" | |
43 | ||
44 | mi_gdb_test "set python print-stack full" \ | |
45 | ".*\\^done" \ | |
46 | "set python print-stack full" | |
47 | ||
b75d55d4 | 48 | mi_runto_main |
5abe0f0c JV |
49 | |
50 | mi_continue_to_line [gdb_get_line_number "next line" ${srcfile}] \ | |
51 | "step to breakpoint" | |
52 | ||
53 | mi_gdb_test "-var-create c1 * &c1" \ | |
54 | "\\^done.*" \ | |
55 | "-var-create c1 * &c1" | |
56 | ||
57 | mi_gdb_test "-var-info-path-expression c1" \ | |
58 | "\\^done,path_expr=\"&c1\"" \ | |
59 | "-var-info-path-expression c1" | |
60 | ||
61 | mi_gdb_test "-var-list-children c1" \ | |
62 | "\\^done,numchild=\"2\",children=.child=\{name=\"c1.car\".*child=\{name=\"c1.cdr\".*" \ | |
63 | "-var-list-children c1" | |
64 | ||
65 | mi_gdb_test "-var-info-path-expression c1.cdr" \ | |
66 | "\\^error,msg=\".*\"" \ | |
67 | "-var-info-path-expression c1.cdr" | |
68 | ||
69 | mi_gdb_test "-var-list-children c1.cdr" \ | |
70 | "\\^done,numchild=\"2\",children=.child=\{name=\"c1.cdr.car\".*child=\{name=\"c1.cdr.cdr\".*" \ | |
71 | "-var-list-children c1.cdr" | |
72 | ||
73 | mi_gdb_test "-var-info-path-expression c1.cdr.cdr" \ | |
74 | "\\^error,msg=\".*\"" \ | |
75 | "-var-info-path-expression c1.cdr.cdr" | |
76 | ||
77 | mi_gdb_test "-var-list-children c1.car" \ | |
78 | "\\^done,numchild=\"1\",children=.child=\{name=\"c1.car.atom\".*" \ | |
79 | "-var-list-children c1.car" | |
80 | ||
81 | mi_gdb_test "-var-list-children c1.car.atom" \ | |
82 | "\\^done,numchild=\"1\",children=.child=\{name=\"c1.car.atom.ival\".*" \ | |
83 | "-var-list-children c1.car.atom" | |
84 | ||
85 | mi_gdb_test "-var-info-path-expression c1.car.atom.ival" \ | |
86 | "\\^error,msg=\".*\"" \ | |
87 | "-var-info-path-expression c1.car.atom.ival" |