-# Copyright (C) 1999 2000 Cygnus Solutions
-#
+# Copyright (C) 1999, 2000, 2002 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
# the Free Software Foundation; either version 2 of the License, or
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
-mi_gdb_test "200-break-insert do_children_tests" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"190\",times=\"0\"\}" \
- "break-insert operation"
-
-mi_run_cmd
-# The running part has been checked already by mi_run_cmd
-gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"190\"\}\r\n$mi_gdb_prompt$" {
- pass "run to do_children_tests"
- }
- -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
- timeout {fail "run to do_children_tests (timeout 2)"}
-}
+mi_runto do_children_tests
##### #####
# #
# Step to "struct_declarations.integer = 123;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"192\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
-
+set line 193
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step to line $line"
# Test: c_variable-4.81
# Desc: create local variable "weird"
"update all vars. None changed"
# Step over "struct_declarations.integer = 123;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"193\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 194
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.2
# Desc: check that integer changed
# weird->char_ptr = "hello";
# bar = 2121;
# foo = &bar;
-
-send_gdb "-exec-step 3\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"196\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 197
+mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
# Test: c_variable-5.3
# Desc: check that char_ptr changed
"update all vars struct_declarations.char_ptr"
# Step over "struct_declarations.int_ptr_ptr = &foo;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"197\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 198
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.4
# Desc: check that int_ptr_ptr and children changed
"update all vars int_ptr_ptr and children changed"
# Step over "weird->long_array[0] = 1234;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"198\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 199
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.5
# Desc: check that long_array[0] changed
"update all vars struct_declarations.long_array.0 changed"
# Step over "struct_declarations.long_array[1] = 2345;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"199\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 200
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.6
# Desc: check that long_array[1] changed
"update all vars struct_declarations.long_array.1 changed"
# Step over "weird->long_array[2] = 3456;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"200\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 201
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.7
# Desc: check that long_array[2] changed
# struct_declarations.long_array[7] = 8901;
# weird->long_array[8] = 9012;
# struct_declarations.long_array[9] = 1234;
-send_gdb "-exec-step 7\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"208\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 209
+mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
# Test: c_variable-5.8
# Desc: check that long_array[3-9] changed
# Step over "weird->func_ptr = nothing;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"211\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 212
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.9
# Desc: check that func_ptr changed
# Step over all lines:
# ...
# psnp = &snp0;
-send_gdb "-exec-step 43\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"254\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 255
+mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
# Test: c_variable-5.10
# Desc: create psnp->char_ptr
"get children of psnp->ptrs.0.next.next.ptrs"
# Step over "snp0.char_ptr = &b3;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"255\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 256
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.47
# Desc: check that psnp->char_ptr (and [0].char_ptr) changed
"update all vars psnp->char_ptr (and 0.char_ptr) changed"
# Step over "snp1.char_ptr = &c3;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"256\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
-
+set line 257
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.48
# Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
# Step over "snp2.char_ptr = &a3;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"257\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
-
+set line 258
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.49
# Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
# Step over "snp0.long_ptr = &y3;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"258\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
+set line 259
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.50
# Desc: check that psnp->long_ptr (and [0].long_ptr) changed
# Step over "snp1.long_ptr = &x3;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"259\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
-
+set line 260
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.51
# Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
#
# Step over "snp2.long_ptr = &z3;"
-send_gdb "-exec-step\n"
-gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" {
- pass "step at do_children_tests"
- }
- timeout {
- fail "step at do_children_tests (timeout)"
- }
-}
-
+set line 261
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
# Test: c_variable-5.52
# Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed