1 # Copyright (C) 2018-2019 Free Software Foundation, Inc.
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.
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.
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/>.
15 # Tests whether -var-info-path-expression fails as documented when
16 # invoked on a dynamic varobj.
18 load_lib mi-support.exp
31 if {[gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable {debug}] != "" } {
35 mi_gdb_test "source ${srcdir}/${subdir}/${testfile}.py" \
39 mi_gdb_test "-enable-pretty-printing" \
41 "-enable-pretty-printing"
43 mi_gdb_test "set python print-stack full" \
45 "set python print-stack full"
51 mi_continue_to_line [gdb_get_line_number "next line" ${srcfile}] \
54 mi_gdb_test "-var-create c1 * &c1" \
56 "-var-create c1 * &c1"
58 mi_gdb_test "-var-info-path-expression c1" \
59 "\\^done,path_expr=\"&c1\"" \
60 "-var-info-path-expression c1"
62 mi_gdb_test "-var-list-children c1" \
63 "\\^done,numchild=\"2\",children=.child=\{name=\"c1.car\".*child=\{name=\"c1.cdr\".*" \
64 "-var-list-children c1"
66 mi_gdb_test "-var-info-path-expression c1.cdr" \
67 "\\^error,msg=\".*\"" \
68 "-var-info-path-expression c1.cdr"
70 mi_gdb_test "-var-list-children c1.cdr" \
71 "\\^done,numchild=\"2\",children=.child=\{name=\"c1.cdr.car\".*child=\{name=\"c1.cdr.cdr\".*" \
72 "-var-list-children c1.cdr"
74 mi_gdb_test "-var-info-path-expression c1.cdr.cdr" \
75 "\\^error,msg=\".*\"" \
76 "-var-info-path-expression c1.cdr.cdr"
78 mi_gdb_test "-var-list-children c1.car" \
79 "\\^done,numchild=\"1\",children=.child=\{name=\"c1.car.atom\".*" \
80 "-var-list-children c1.car"
82 mi_gdb_test "-var-list-children c1.car.atom" \
83 "\\^done,numchild=\"1\",children=.child=\{name=\"c1.car.atom.ival\".*" \
84 "-var-list-children c1.car.atom"
86 mi_gdb_test "-var-info-path-expression c1.car.atom.ival" \
87 "\\^error,msg=\".*\"" \
88 "-var-info-path-expression c1.car.atom.ival"