1 # Copyright 2006-2022 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 if { [skip_cplus_tests] } { continue }
18 load_lib mi-support.exp
28 if [get_compiler_info "c++"] {
32 if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""} {
33 untested "failed to compile"
37 mi_gdb_load ${binfile}
39 mi_prepare_inline_tests $srcfile
49 foreach inline_test $inline_tests {
50 if { [mi_run_inline_test $inline_test] < 0 } {
55 set lineno [gdb_get_line_number "/* anonymous_structs_and_unions */"]
56 mi_create_breakpoint "$srcfile:$lineno" \
57 "break in anonymous_structs_and_unions" \
58 -func {anonymous_structs_and_unions\(\)} -file ".*mi-var-cp.cc" \
60 mi_execute_to "exec-continue" "breakpoint-hit" \
61 "anonymous_structs_and_unions" "" ".*" ".*" {"" "disp=\"keep\""} \
62 "continue to anonymous_structs breakpoint"
108 proc verify_everything {variable_name} {
109 # Test -var-list-children
110 mi_varobj_tree_test_children_callback $variable_name
112 # Bring the variable named by VARIABLE_NAME into the current scope
114 upvar #0 $variable_name varobj
116 # Test -var-info-path-expression
117 mi_gdb_test "-var-info-path-expression $varobj(obj_name)" \
118 "\\^done,path_expr=\"[string_to_regexp $varobj(path_expr)]\"" \
119 "path expression for $varobj(obj_name)"
121 # Test -var-info-expression
122 mi_gdb_test "-var-info-expression $varobj(obj_name)" \
123 "\\^done,lang=\"C\\+\\+\",exp=\"[string_to_regexp $varobj(display_name)]\"" \
124 "expression for $varobj(obj_name)"
127 mi_walk_varobj_tree c++ $tree verify_everything