2004-08-17 Michael Chastain <mec.gnu@mindspring.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi2-var-child.exp
index 9daf2aab67f183c8aa200888f6f78905d3624c3a..be2dc849214aa632e76668ae193c99cb91f8143c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+# Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
 
 # 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
@@ -14,9 +14,6 @@
 # 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
-
 # Test essential Machine interface (MI) operations
 #
 # Verify that, using the MI, we can create, update, delete variables.
@@ -555,8 +552,9 @@ mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr
 
 
 # Step to "struct_declarations.integer = 123;"
-set line 192
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step to line $line"
+set line_dct_123 [gdb_get_line_number "struct_declarations.integer = 123;"]
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+      $line_dct_123 "step to line \$line_dct_123"
 
 # Test: c_variable-4.81
 # Desc: create local variable "weird"
@@ -754,8 +752,8 @@ mi_gdb_test "-var-update *" \
        "update all vars. None changed"
 
 # Step over "struct_declarations.integer = 123;"
-set line 193
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_123 + 1] "step \$line_dct_123 + 1"
 
 # Test: c_variable-5.2
 # Desc: check that integer changed
@@ -767,8 +765,8 @@ mi_gdb_test "-var-update *" \
 #    weird->char_ptr = "hello";
 #    bar = 2121;
 #    foo = &bar;
-set line 196
-mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
+mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_123 + 4] {} "step \$line_dct_123 + 4"
 
 # Test: c_variable-5.3
 # Desc: check that char_ptr changed
@@ -777,8 +775,8 @@ mi_gdb_test "-var-update *" \
        "update all vars struct_declarations.char_ptr"
 
 # Step over "struct_declarations.int_ptr_ptr = &foo;"
-set line 197
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_123 + 5] "step \$line_dct_123 + 5"
 
 # Test: c_variable-5.4
 # Desc: check that int_ptr_ptr and children changed
@@ -787,8 +785,8 @@ mi_gdb_test "-var-update *" \
        "update all vars int_ptr_ptr and children changed"
 
 # Step over "weird->long_array[0] = 1234;"
-set line 198
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_123 + 6] "step \$line_dct_123 + 6"
 
 # Test: c_variable-5.5
 # Desc: check that long_array[0] changed
@@ -797,8 +795,8 @@ mi_gdb_test "-var-update *" \
        "update all vars struct_declarations.long_array.0 changed"
 
 # Step over "struct_declarations.long_array[1] = 2345;"
-set line 199
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_123 + 7] "step \$line_dct_123 + 7"
 
 # Test: c_variable-5.6
 # Desc: check that long_array[1] changed
@@ -807,8 +805,8 @@ mi_gdb_test "-var-update *" \
        "update all vars struct_declarations.long_array.1 changed"
 
 # Step over "weird->long_array[2] = 3456;"
-set line 200
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_123 + 8] "step \$line_dct_123 + 8"
 
 # Test: c_variable-5.7
 # Desc: check that long_array[2] changed
@@ -824,8 +822,10 @@ mi_gdb_test "-var-update *" \
 #    struct_declarations.long_array[7] = 8901;
 #    weird->long_array[8] = 9012;
 #    struct_declarations.long_array[9] = 1234;
-set line 208
-mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
+
+set line_dct_nothing [gdb_get_line_number "weird->func_ptr = nothing;"]
+mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd.c} \
+    $line_dct_nothing {} "step \$line_dct_nothing"
 
 # Test: c_variable-5.8
 # Desc: check that long_array[3-9] changed
@@ -835,8 +835,9 @@ mi_gdb_test "-var-update *" \
 
 
 # Step over "weird->func_ptr = nothing;"
-set line 211
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+set line_dct_a0_0 [gdb_get_line_number "a0 = '0';"]
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    $line_dct_a0_0 "step \$line_dct_a0_0"
 
 # Test: c_variable-5.9
 # Desc: check that func_ptr changed
@@ -856,8 +857,10 @@ mi_gdb_test "-var-delete weird->int_ptr_ptr" \
 # Step over all lines:
 # ...
 #   psnp = &snp0;
-set line 254
-mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
+
+set line_dct_snp0 [gdb_get_line_number "psnp = &snp0;"]
+mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_snp0 + 1] {} "step \$line_dct_snp0 + 1"
 
 # Test: c_variable-5.10
 # Desc: create psnp->char_ptr
@@ -1127,8 +1130,8 @@ mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \
        "get children of psnp->ptrs.0.next.next.ptrs"
 
 #  Step over "snp0.char_ptr = &b3;"
-set line 255
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_snp0 + 2] "step \$line_dct_snp0 + 2"
 
 # Test: c_variable-5.47
 # Desc: check that psnp->char_ptr (and [0].char_ptr) changed
@@ -1137,8 +1140,8 @@ mi_gdb_test "-var-update *" \
        "update all vars psnp->char_ptr (and 0.char_ptr) changed"
 
 #  Step over "snp1.char_ptr = &c3;"
-set line 256
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_snp0 + 3] "step \$line_dct_snp0 + 3"
 
 # Test: c_variable-5.48
 # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
@@ -1148,8 +1151,8 @@ mi_gdb_test "-var-update *" \
 
 
 #  Step over "snp2.char_ptr = &a3;"
-set line 257
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_snp0 + 4] "step \$line_dct_snp0 + 4"
 
 # Test: c_variable-5.49
 # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
@@ -1159,8 +1162,8 @@ mi_gdb_test "-var-update *" \
 
 
 #  Step over "snp0.long_ptr = &y3;"
-set line 258
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_snp0 + 5] "step \$line_dct_snp0 + 5"
 
 # Test: c_variable-5.50
 # Desc: check that psnp->long_ptr (and [0].long_ptr) changed
@@ -1170,8 +1173,8 @@ mi_gdb_test "-var-update *" \
 
 
 #  Step over "snp1.long_ptr = &x3;"
-set line 259
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_snp0 + 6] "step \$line_dct_snp0 + 6"
 
 # Test: c_variable-5.51
 # Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
@@ -1187,8 +1190,8 @@ clear_xfail *-*-*
 #
 
 #  Step over "snp2.long_ptr = &z3;"
-set line 260
-mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+mi_step_to do_children_tests {} {.*var-cmd.c} \
+    [expr $line_dct_snp0 + 7] "step \$line_dct_snp0 + 7"
 
 # Test: c_variable-5.52
 # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed
This page took 0.036816 seconds and 4 git commands to generate.