From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8499 invoked by alias); 19 May 2010 20:26:51 -0000 Received: (qmail 8488 invoked by uid 22791); 19 May 2010 20:26:50 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 May 2010 20:26:42 +0000 Received: from jupiter.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id CAE9248003 for ; Wed, 19 May 2010 13:26:38 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by jupiter.vmware.com (Postfix) with ESMTP id C16ACDC051 for ; Wed, 19 May 2010 13:26:38 -0700 (PDT) Message-ID: <4BF4497E.9040209@vmware.com> Date: Wed, 19 May 2010 20:54:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.22 (X11/20090609) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: [rfa] gdb.base/volatile.exp / varargs.exp: replace send_gdb with gdb_test Content-Type: multipart/mixed; boundary="------------090909030605040802060806" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00396.txt.bz2 This is a multi-part message in MIME format. --------------090909030605040802060806 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 0 --------------090909030605040802060806 Content-Type: text/plain; name="v.exp.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v.exp.txt" Content-length: 6287 2010-05-19 Michael Snyder * gdb.base/varargs.exp: Replace send_gdb with gdb_test. * gdb.base/volatile.exp: Replace send_gdb with gdb_test. Index: varargs.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/varargs.exp,v retrieving revision 1.12 diff -u -p -r1.12 varargs.exp --- varargs.exp 5 May 2010 18:06:58 -0000 1.12 +++ varargs.exp 19 May 2010 20:23:15 -0000 @@ -62,9 +62,13 @@ gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $" -send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $" -send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $" +gdb_test "set print sevenbit-strings" "" \ + "set print sevenbit-strings; ${testfile}" +gdb_test "set print address off" "" \ + "set print address off; ${testfile}" +gdb_test "set width 0" "" \ + "set width 0; ${testfile}" + if [gdb_skip_stdio_test "varargs.exp"] { # Nothing in this module is testable without printf. @@ -89,57 +93,25 @@ if { $hp_aCC_compiler } { gdb_test "set overload-resolution 0" "" } -send_gdb "print find_max1(5,1,2,3,4,5)\n" -gdb_expect { - -re ".*find_max\\(5, 1, 2, 3, 4, 5\\) returns 5\[ \r\n\]+.\[0-9\]+ = 5.*$gdb_prompt $" { - pass "print find_max1(5,1,2,3,4,5)" - } - -re ".*$gdb_prompt $" { fail "print find_max1(5,1,2,3,4,5)" } - timeout { fail "(timeout) print find_max1(5,1,2,3,4,5)" } - } - - - - -send_gdb "print find_max1(1,3)\n" -gdb_expect { - -re ".*find_max\\(1, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3.*$gdb_prompt $" { - pass "print find_max1(1,3)" - } - -re ".*$gdb_prompt $" { fail "print find_max1(1,3)" } - timeout { fail "(timeout) print find_max1(1,3)" } - } - - -send_gdb "print find_max1(10,1,2,3,4,5,6,7,8,29,0)\n" -gdb_expect { - -re ".*find_max\\(10, 1, 2, 3, 4, 5, 6, 7, 8, 29, 0\\) returns 29\[ \r\n\]+.\[0-9\]+ = 29.*$gdb_prompt $" { - pass "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" - } - -re ".*$gdb_prompt $" { fail "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" } - timeout { fail "(timeout) print find_max1(10,1,2,3,4,5,6,7,8,29,0)" } - } - - - -send_gdb "print find_max2(3,1,2,3)\n" -gdb_expect { - -re ".*find_max\\(3, 1, 2, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3.*$gdb_prompt $" { - pass "print find_max2(3,1,2,3)" - } - -re ".*$gdb_prompt $" { fail "print find_max2(3,1,2,3)" } - timeout { fail "(timeout) print find_max2(3,1,2,3)" } - } - +gdb_test "print find_max1(5,1,2,3,4,5)" \ + "find_max\\(5, 1, 2, 3, 4, 5\\) returns 5\[ \r\n\]+.\[0-9\]+ = 5" \ + "print find_max1(5,1,2,3,4,5)" + +gdb_test "print find_max1(1,3)" \ + ".*find_max\\(1, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3" \ + "print find_max1(1,3)" + +gdb_test "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" \ + ".*find_max\\(10, 1, 2, 3, 4, 5, 6, 7, 8, 29, 0\\) returns 29\[ \r\n\]+.\[0-9\]+ = 29" \ + "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" + +gdb_test "print find_max2(3,1,2,3)" \ + ".*find_max\\(3, 1, 2, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3" \ + "print find_max2(3,1,2,3)" if {![target_info exists gdb,skip_float_tests]} { - send_gdb "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)\n" - gdb_expect { - -re ".*find_max\\(.*\\) returns 17\\.000000\[ \r\n\]+.\[0-9\]+ = 17.*$gdb_prompt $" { - pass "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" - } - -re ".*$gdb_prompt $" { fail "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" } - timeout { fail "(timeout) print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" } - } + gdb_test "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" \ + ".*find_max\\(.*\\) returns 17\\.000000\[ \r\n\]+.\[0-9\]+ = 17" \ + "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" } Index: volatile.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/volatile.exp,v retrieving revision 1.18 diff -u -p -r1.18 volatile.exp --- volatile.exp 5 May 2010 18:06:58 -0000 1.18 +++ volatile.exp 19 May 2010 20:23:15 -0000 @@ -87,28 +87,17 @@ proc local_compiler_xfail_check_2 { } { } } -send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $" +gdb_test "break marker1" "" "" - send_gdb "cont\n" - gdb_expect { - -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" { - send_gdb "up\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "up from marker1" } - } - } - -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" { - fail "continue to marker1 (demangling)" - send_gdb "up\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "up from marker1" } - } - } - -re "$gdb_prompt $" { fail "continue to marker1" } - timeout { fail "(timeout) continue to marker1" } +gdb_test_multiple "cont" "continue to marker1" { + -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" { + pass "continue to marker1" } + -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" { + fail "continue to marker1 (demangling)" + } +} +gdb_test "up" " in main .*" "up from marker1" # As of Feb 1999, GCC does not issue info about volatility of vars, so # these tests are all expected to fail if GCC is the compiler. -sts @@ -248,11 +237,7 @@ gdb_test "ptype vendor" "type = const vo # test function parameters local_compiler_xfail_check local_compiler_xfail_check_2 -send_gdb "ptype qux2\n" -gdb_expect { - -re "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\).*$gdb_prompt $" { - pass "ptype qux2" - } - -re ".*$gdb_prompt $" { fail "ptype qux2" } - timeout { fail "(timeout) ptype qux2" } - } + +gdb_test "ptype qux2" \ + "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\)" \ + "ptype qux2" --------------090909030605040802060806--