This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/MI testsuite] cleanup mi-var-children.exp


It looks nice to me.  But Andrew looks after the mi tests...

Regards,
Fernando

Keith Seitz wrote:
Hi,

This patch is really a nop, but it really cleans up mi-var-children.exp. It removes all the send_gdb/gdb_expect statements for executing the inferior with the testsuite's built-in commands.

Before/after run on testsuite: no changes.

When this is in, I'll submit my crashing-bug test and its fix.
Keith

ChangeLog
2002-09-13 Keith Seitz <keiths@redhat.com>

* mi-var-child.exp: Use mi_step_to and mi_execute_to instead
of a bunch of repeated send_gdb/gdb_expect statements.

Patch
Index: testsuite/gdb.mi/mi-var-child.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-child.exp,v
retrieving revision 1.9
diff -p -r1.9 mi-var-child.exp
*** testsuite/gdb.mi/mi-var-child.exp 9 May 2002 18:29:33 -0000 1.9
--- testsuite/gdb.mi/mi-var-child.exp 13 Sep 2002 20:43:59 -0000
***************
*** 1,5 ****
! # Copyright (C) 1999 2000 Cygnus Solutions
! #
# 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
--- 1,5 ----
! # 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_delete_breakpoints
*** 42,60 ****
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)"}
! }
##### #####
# #
--- 42,48 ----
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
! mi_runto do_children_tests
##### #####
# #
*************** mi_gdb_test "-var-info-num-children stru
*** 567,582 ****
# 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)"
! }
! }
! # Test: c_variable-4.81
# Desc: create local variable "weird"
--- 555,562 ----
# Step to "struct_declarations.integer = 123;"
! 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"
*************** mi_gdb_test "-var-update *" \
*** 774,788 ****
"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)"
! }
! }
# Test: c_variable-5.2
# Desc: check that integer changed
--- 754,761 ----
"update all vars. None changed"
# Step over "struct_declarations.integer = 123;"
! 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
*************** mi_gdb_test "-var-update *" \
*** 794,809 ****
# 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)"
! }
! }
# Test: c_variable-5.3
# Desc: check that char_ptr changed
--- 767,774 ----
# weird->char_ptr = "hello";
# bar = 2121;
# foo = &bar;
! 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
*************** mi_gdb_test "-var-update *" \
*** 812,826 ****
"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)"
! }
! }
# Test: c_variable-5.4
# Desc: check that int_ptr_ptr and children changed
--- 777,784 ----
"update all vars struct_declarations.char_ptr"
# Step over "struct_declarations.int_ptr_ptr = &foo;"
! 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
*************** mi_gdb_test "-var-update *" \
*** 829,843 ****
"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)"
! }
! }
# Test: c_variable-5.5
# Desc: check that long_array[0] changed
--- 787,794 ----
"update all vars int_ptr_ptr and children changed"
# Step over "weird->long_array[0] = 1234;"
! 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
*************** mi_gdb_test "-var-update *" \
*** 846,860 ****
"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)"
! }
! }
# Test: c_variable-5.6
# Desc: check that long_array[1] changed
--- 797,804 ----
"update all vars struct_declarations.long_array.0 changed"
# Step over "struct_declarations.long_array[1] = 2345;"
! 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
*************** mi_gdb_test "-var-update *" \
*** 863,877 ****
"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)"
! }
! }
# Test: c_variable-5.7
# Desc: check that long_array[2] changed
--- 807,814 ----
"update all vars struct_declarations.long_array.1 changed"
# Step over "weird->long_array[2] = 3456;"
! 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
*************** mi_gdb_test "-var-update *" \
*** 887,901 ****
# 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)"
! }
! }
# Test: c_variable-5.8
# Desc: check that long_array[3-9] changed
--- 824,831 ----
# struct_declarations.long_array[7] = 8901;
# weird->long_array[8] = 9012;
# struct_declarations.long_array[9] = 1234;
! 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
*************** mi_gdb_test "-var-update *" \
*** 905,919 ****
# 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)"
! }
! }
# Test: c_variable-5.9
# Desc: check that func_ptr changed
--- 835,842 ----
# Step over "weird->func_ptr = nothing;"
! 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
*************** mi_gdb_test "-var-delete weird->int_ptr_
*** 933,947 ****
# 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)"
! }
! }
# Test: c_variable-5.10
# Desc: create psnp->char_ptr
--- 856,863 ----
# Step over all lines:
# ...
# psnp = &snp0;
! 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
*************** mi_gdb_test "-var-list-children psnp->pt
*** 1211,1225 ****
"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)"
! }
! }
# Test: c_variable-5.47
# Desc: check that psnp->char_ptr (and [0].char_ptr) changed
--- 1127,1134 ----
"get children of psnp->ptrs.0.next.next.ptrs"
# Step over "snp0.char_ptr = &b3;"
! 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
*************** mi_gdb_test "-var-update *" \
*** 1228,1243 ****
"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)"
! }
! }
! # Test: c_variable-5.48
# Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
--- 1137,1144 ----
"update all vars psnp->char_ptr (and 0.char_ptr) changed"
# Step over "snp1.char_ptr = &c3;"
! 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
*************** mi_gdb_test "-var-update *" \
*** 1247,1262 ****
# 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)"
! }
! }
! # Test: c_variable-5.49
# Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
--- 1148,1155 ----
# Step over "snp2.char_ptr = &a3;"
! 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
*************** mi_gdb_test "-var-update *" \
*** 1266,1280 ****
# 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)"
! }
! }
# Test: c_variable-5.50
# Desc: check that psnp->long_ptr (and [0].long_ptr) changed
--- 1159,1166 ----
# Step over "snp0.long_ptr = &y3;"
! 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
*************** mi_gdb_test "-var-update *" \
*** 1284,1299 ****
# 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)"
! }
! }
! # Test: c_variable-5.51
# Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
--- 1170,1177 ----
# Step over "snp1.long_ptr = &x3;"
! 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
*************** clear_xfail *-*-*
*** 1309,1324 ****
#
# 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)"
! }
! }
! # Test: c_variable-5.52
# Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed
--- 1187,1194 ----
#
# Step over "snp2.long_ptr = &z3;"
! 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


--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]