-# Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008
+# Free Software Foundation, Inc.
#
-# This Program Is Free software; you can redistribute it and/or modify
+# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test essential Machine interface (MI) operations
#
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ untested mi2-var-block.exp
+ return -1
}
mi_delete_breakpoints
# Test: c_variable-3.2
# Desc: create cb and foo
mi_gdb_test "-var-create cb * cb" \
- "\\^done,name=\"cb\",numchild=\"0\",type=\"int\"" \
+ "\\^done,name=\"cb\",numchild=\"0\",value=\".*\",type=\"int\"" \
"create local variable cb"
mi_gdb_test "-var-create foo * foo" \
"create local variable foo"
# step to "foo = 123;"
-mi_step_to "do_block_tests" "" "var-cmd.c" "158" "step at do_block_test"
+mi_step_to "do_block_tests" "" "var-cmd.c" \
+ [gdb_get_line_number "foo = 123;"] \
+ "step at do_block_test"
# Be paranoid and assume 3.2 created foo
# Test: c_variable-3.3
# Desc: create foo
mi_gdb_test "-var-create foo * foo" \
- "\\^done,name=\"foo\",numchild=\"0\",type=\"int\"" \
+ "\\^done,name=\"foo\",numchild=\"0\",value=\".*\",type=\"int\"" \
"create local variable foo"
# step to "foo2 = 123;"
-mi_step_to "do_block_tests" "" "var-cmd.c" "161" "step at do_block_test"
+mi_step_to "do_block_tests" "" "var-cmd.c" \
+ [gdb_get_line_number "foo2 = 123;"] \
+ "step at do_block_test"
# Test: c_variable-3.4
# Desc: check foo, cb changed
"update all vars: cb foo changed"
# step to "foo = 321;"
-mi_step_to "do_block_tests" "" "var-cmd.c" "164" "step at do_block_test"
+mi_step_to "do_block_tests" "" "var-cmd.c" \
+ [gdb_get_line_number "foo = 321;"] \
+ "step at do_block_test"
# Test: c_variable-3.5
# Desc: create inner block foo
mi_gdb_test "-var-create inner_foo * foo" \
- "\\^done,name=\"inner_foo\",numchild=\"0\",type=\"int\"" \
+ "\\^done,name=\"inner_foo\",numchild=\"0\",value=\".*\",type=\"int\"" \
"create local variable inner_foo"
# step to "foo2 = 0;"
-mi_step_to "do_block_tests" "" "var-cmd.c" "166" "step at do_block_test"
+mi_step_to "do_block_tests" "" "var-cmd.c" \
+ [gdb_get_line_number "foo2 = 0;"] \
+ "step at do_block_test"
# Test: c_variable-3.6
# Desc: create foo2
mi_gdb_test "-var-create foo2 * foo2" \
- "\\^done,name=\"foo2\",numchild=\"0\",type=\"int\"" \
+ "\\^done,name=\"foo2\",numchild=\"0\",value=\".*\",type=\"int\"" \
"create local variable foo2"
# Test: c_variable-3.7
"delete var inner_foo"
# step to "foo = 0;"
-mi_step_to "do_block_tests" "" "var-cmd.c" "168" "step at do_block_test"
+mi_step_to "do_block_tests" "" "var-cmd.c" \
+ [gdb_get_line_number "foo = 0;"] \
+ "step at do_block_test"
# Test: c_variable-3.8
# Desc: check that foo2 out of scope (known gdb problem)
clear_xfail *-*-*
# step to "cb = 21;"
-mi_step_to "do_block_tests" "" "var-cmd.c" "171" "step at do_block_test"
+mi_step_to "do_block_tests" "" "var-cmd.c" \
+ [gdb_get_line_number "cb = 21;"] \
+ "step at do_block_test"
# Test: c_variable-3.9
# Desc: check that only cb is in scope (known gdb problem)