2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 if { [skip_cplus_tests] } { continue }
19 load_lib mi-support.exp
27 set testfile mi-inheritance-syntax-error
28 set srcfile "$testfile.cc"
29 set binfile $objdir/$subdir/$testfile
31 if [get_compiler_info ${binfile} "c++"] {
35 if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""} {
36 untested mi-inheritance-syntax-error.exp
40 # Test that children of derived classes are given the proper
41 # path by -var-info-path-expression
43 mi_gdb_load ${binfile}
44 mi_runto C::testLocation
46 mi_create_varobj "var1" "this" "create var for THIS"
48 mi_list_varobj_children "var1" {
50 {var1.public public 1}
51 } "list children of THIS"
53 # We don't care what the result of -var-info-path-expression
54 # as long as it can be used in the -data-evaluate-expression
56 mi_gdb_test "-var-info-path-expression var1.A" \
57 "\\^done,path_expr=\".*\"" \
58 "-var-info-path-expression var1.A"
60 # Extract the result of the -var-info-path-expression command
61 # to use it in -data-evaluate-expression
62 set cmd_output $expect_out(2,string)
63 set path [lindex [split $cmd_output "\""] 1]
64 verbose "var-info-path-expression returned $cmd_output" 2
65 verbose "Using $path for data-evaluate-expression" 2
68 mi_gdb_test "-data-evaluate-expression \"$path\"" \
69 "\\^done,value=\"\{a = 5\}\"" \
70 "-data-evaluate-expression $path"