From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21543 invoked by alias); 22 May 2010 21:19:50 -0000 Received: (qmail 21527 invoked by uid 22791); 22 May 2010 21:19:44 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_50,TW_CP,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; Sat, 22 May 2010 21:19:34 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 1BADB1A016 for ; Sat, 22 May 2010 14:19:31 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost3.vmware.com (Postfix) with ESMTP id 07742CD910 for ; Sat, 22 May 2010 14:19:31 -0700 (PDT) Message-ID: <4BF84A62.40806@vmware.com> Date: Sat, 22 May 2010 22:33: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/c*.exp, send_gdb vs. gdb_test Content-Type: multipart/mixed; boundary="------------000901030605030503030109" 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/msg00531.txt.bz2 This is a multi-part message in MIME format. --------------000901030605030503030109 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 0 --------------000901030605030503030109 Content-Type: text/plain; name="c.exp.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="c.exp.txt" Content-length: 59943 2010-05-22 Michael Snyder * gdb.base/call-ar-st.exp: Replace send_gdb with gdb_test. * gdb.base/callfuncs.exp: Replace send_gdb with gdb_test. * gdb.base/call-rt-st.exp: Replace send_gdb with gdb_test. * gdb.base/call-signal-resume.exp: Replace send_gdb with gdb_test. * gdb.base/call-strs.exp: Replace send_gdb with gdb_test. * gdb.base/catch-syscall.exp: Replace send_gdb with gdb_test. * gdb.base/charset.exp: Replace send_gdb with gdb_test. * gdb.base/checkpoint.exp: Replace send_gdb with gdb_test. * gdb.base/commands.exp: Replace send_gdb with gdb_test. * gdb.base/condbreak.exp: Replace send_gdb with gdb_test. * gdb.base/cond-exprs.exp: Replace send_gdb with gdb_test. * gdb.base/consecutive.exp: Replace send_gdb with gdb_test. * gdb.base/constvars.exp: Replace send_gdb with gdb_test. * gdb.base/corefile.exp: Replace send_gdb with gdb_test. Index: call-ar-st.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-ar-st.exp,v retrieving revision 1.24 diff -u -p -r1.24 call-ar-st.exp --- call-ar-st.exp 5 May 2010 18:06:57 -0000 1.24 +++ call-ar-st.exp 22 May 2010 21:15:10 -0000 @@ -61,24 +61,19 @@ set timeout [expr "$timeout + 60"] proc set_lang_c {} { global gdb_prompt =20 - send_gdb "set language c\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "set language c (timeout)" ; return 0; } - } + gdb_test_no_output "set language c" =20 - send_gdb "show language\n" - gdb_expect { + gdb_test_multiple "show language" "set language to \"c\"" { -re ".* source language is \"c\".*$gdb_prompt $" { pass "set language to \"c\"" return 1 } -re ".*$gdb_prompt $" { - fail "setting language to \"c\"" + fail "set language to \"c\"" return 0 } timeout { - fail "can't show language (timeout)" + fail "(timeout) set language to \"c\"" return 0 } } @@ -90,9 +85,9 @@ 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_no_output "set print sevenbit-strings" +gdb_test_no_output "set print address off" +gdb_test_no_output "set width 0" =20 =20 if ![runto_main] then { @@ -201,28 +196,15 @@ if {![gdb_skip_float_test "continuing to } =20 #step -send_gdb "step\n" -gdb_expect { - -re "print_all_arrays \\(array_i=3D, array_c=3D.ZaZaZaZaZaZaZaZaZaZaZa= ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ= aZaZaZaZaZaZaZaZaZaZaZa., array_f=3D, array_d=3D\\) at .*call-ar-st.c:306\[= \t\r\n\]+306.*print_int_array\\(array_i\\);.*$gdb_prompt $" {pass "step in= side print_all_arrays"} - -re ".*$gdb_prompt $" { fail "step inside print_all_arrays" } - timeout { fail "step inside print_all_arrays (timeout)" } -} - +gdb_test "step" \ + "print_all_arrays \\(array_i=3D, array_c=3D.ZaZaZaZaZaZaZaZaZaZaZaZaZa= ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ= aZaZaZaZaZaZaZaZaZa., array_f=3D, array_d=3D\\) at .*call-ar-st.c:306\[ \t\= r\n\]+306.*print_int_array\\(array_i\\);.*" \ + "step inside print_all_arrays" =20 #step -over if ![gdb_skip_stdio_test "next over print_int_array in print_all_arrays"] { - send_gdb "next\n" - gdb_expect { - -re "array_i :.*307.*print_char_array.*$gdb_prompt $" { - pass "next over print_int_array in print-all_arrays" - } - -re ".*$gdb_prompt $" {=20 - fail "next over print_int_array in print-all_arrays"=20 - } - timeout {=20 - fail "next over print_int_array in print-all_arrays (timeout)" - } - } + gdb_test "next" \ + "array_i :.*307.*print_char_array.*" \ + "next over print_int_array in print-all_arrays" } else { gdb_test "next" "" "" } @@ -265,24 +247,16 @@ if {![gdb_skip_float_test "continuing to #call sum_array_print(10, *list1, *list2, *list3, *list4) =20 if ![gdb_skip_stdio_test "print sum_array_print(...)"] { - send_gdb "print sum_array_print(10, *list1, *list2, *list3, *list4)\n" - gdb_expect { - -re ".*Sum of 4 arrays, by element \\(add in seed as well\\):\[ \t\r\n\]+= Seed: 10\[ \t\r\n\]+Element Index . Sum\[ \t\r\n\]+------------------------= -\[ \t\r\n\]+.*\[ \t\]+0\[ \t\]+52\[ \t\r\n\]+1\[ \t\]+60\[ \t\r\n\]+2\[ \t= \]+68\[ \t\r\n\]+3\[ \t\]+76\[ \t\r\n\]+4\[ \t\]+84\[ \t\r\n\]+5\[ \t\]+92\= [ \t\r\n\]+6\[ \t\]+100\[ \t\r\n\]+7\[ \t\]+108\[ \t\r\n\]+8\[ \t\]+116\[ \= t\r\n\]+9\[ \t\]+124\[ \t\r\n\]+.*$gdb_prompt $" { - pass "print sum_array_print(10, *list1, *list2, *list3, *list4)" - } - -re ".*$gdb_prompt $" { fail "print sum_array_print(10, *list1, *list2, *= list3, *list4)" } - timeout { fail "(timeout) print sum_array_print(10, *list1, *li= st2, *list3, *list4)" } - } + gdb_test "print sum_array_print(10, *list1, *list2, *list3, *list4)" \ + ".*Sum of 4 arrays, by element \\(add in seed as well\\):\[ \t\r\n\]+Seed= : 10\[ \t\r\n\]+Element Index . Sum\[ \t\r\n\]+-------------------------\[ = \t\r\n\]+.*\[ \t\]+0\[ \t\]+52\[ \t\r\n\]+1\[ \t\]+60\[ \t\r\n\]+2\[ \t\]+6= 8\[ \t\r\n\]+3\[ \t\]+76\[ \t\r\n\]+4\[ \t\]+84\[ \t\r\n\]+5\[ \t\]+92\[ \t= \r\n\]+6\[ \t\]+100\[ \t\r\n\]+7\[ \t\]+108\[ \t\r\n\]+8\[ \t\]+116\[ \t\r\= n\]+9\[ \t\]+124\[ \t\r\n\]+.*" \ + "print sum_array_print(10, *list1, *list2, *list3, *list4)" } =20 #step over if ![gdb_skip_stdio_test "next to 1237"] { - send_gdb "next\n" - gdb_expect { - -re ".*BYE BYE FOR NOW.*1237.*printf\\(.VERY GREEN GRASS.n.\\);.*$gdb_pro= mpt $" { pass "next to 1237"} - -re ".*$gdb_prompt $" { fail "next to 1237" } - timeout { fail "next to 1237(timeout)" } - } + gdb_test "next" \ + "BYE BYE FOR NOW.*1237.*printf\\(.VERY GREEN GRASS.n.\\);.*" \ + "next to 1237" } else { gdb_test "next" "" "" } @@ -290,18 +264,9 @@ if ![gdb_skip_stdio_test "next to 1237"] #call print_array_rep(\*list1, \*list2, \*list3) =20 if ![gdb_skip_stdio_test "print print_array_rep(...)"] { - send_gdb "print print_array_rep(\*list1, \*list2, \*list3)\n" - gdb_expect { - -re ".*$gdb_prompt $" { - pass "print print_array_rep(*list1, *list2, *list3)" - } - -re ".*$gdb_prompt $" {=20 - fail "print print_array_rep(*list1, *list2, *list3)"=20 - } - timeout { - fail "(timeout) print print_array_rep(*list1, *list2, *list3)"=20 - } - } + gdb_test "print print_array_rep(\*list1, \*list2, \*list3)" \ + "Contents of linked list3:.*" \ + "print print_array_rep(*list1, *list2, *list3)" } =20 #go -until 1241 @@ -309,14 +274,9 @@ gdb_test "tbreak 1241" \ "Temporary breakpoint..* file .*$srcfile, line 1241.*" \ "tbreakpoint line 1241" =20 -send_gdb "continue\n" -gdb_expect { - -re ".*main \\(\\) at .*call-ar-st.c:1241\r\n1241\[\t \]+sum_array_print\= \(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*$gdb_prompt $" { - pass "continue to 1241"} - -re ".*$gdb_prompt $" { fail "continue to 1241"} - timeout { fail "(timeout) continue to 1241"} -} - +gdb_test "continue" \ + "main \\(\\) at .*call-ar-st.c:1241\r\n1241\[\t \]+sum_array_print\\(1= 0, \\*list1, \\*list2, \\*list3, \\*list4\\);.*" \ + "continue to 1241" =20 =20 # Run into sum_array_print, and verify that the arguments were passed @@ -355,14 +315,9 @@ gdb_test "tbreak 1281" \ "tbreakpoint line 1281" =20 if ![gdb_skip_stdio_test "continuing to 1281"] { - send_gdb "continue\n" - gdb_expect { - -re "Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents = of two_floats_t.*main \\(\\) at .*call-ar-st.c:1281.*c =3D 0.*$gdb_prompt $= " { - pass "continue to 1281" - } - -re ".*$gdb_prompt $" { fail "continue to 1281"}=20=20=20=20=20=20=20=20= =20=20=20 - timeout { fail "(timeout) continue to 1281"} - } + gdb_test "continue" \ + "Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents of tw= o_floats_t.*main \\(\\) at .*call-ar-st.c:1281.*c =3D 0.*" \ + "continue to 1281" } else { gdb_test "continue" "" "" } @@ -412,14 +367,9 @@ if {![gdb_skip_float_test "print print_s } =20 #call compute_with_small_structs(20) -send_gdb "print compute_with_small_structs(20)\n" -gdb_expect { - -re ".*\[0-9\]+ =3D.*$gdb_prompt $" { - pass "print compute_with_small_structs(20)" - } - -re ".*$gdb_prompt $" { fail "print compute_with_small_structs(20)" } - timeout { fail "(timeout) compute_with_small_structs(20)" } - } +gdb_test "print compute_with_small_structs(20)" \ + "\[0-9\]+ =3D void" \ + "print compute_with_small_structs(20)" =20 =20 #call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098,= =20 @@ -456,12 +406,9 @@ if { [istarget "hppa*-*-hpux*"] } { # FIXME: use step for hppa* testing for now # guo 990621 # - send_gdb "step\n" - gdb_expect { - -re ".*print_long_arg_list.*\\(a=3D22.25, b=3D33.375, c=3D0, d=3D-= 25, e=3D100, f=3D2345, struct1=3D\{value =3D 6, head =3D 0\}, struct2=3D\{v= alue =3D 10, head =3D 0\}, struct3=3D\{value =3D 12, head =3D 0\}, struct4= =3D\{value =3D 14, head =3D 0\}, flags=3D\{alpha =3D 1, beta =3D 0, gamma = =3D 1, delta =3D 0, epsilon =3D 1, omega =3D 0\}, flags_combo=3D\{alpha =3D= 1, beta =3D 0, ch1 =3D 121 \'y\', gamma =3D 1, delta =3D 0, ch2 =3D 110 \'= n\', epsilon =3D 1, omega =3D 0\}, three_char=3D\{ch1 =3D 97 \'a\', ch2 =3D= 98 \'b\', ch3 =3D 99 \'c\'\}, five_char=3D\{ch1 =3D 108 \'l\', ch2 =3D 109= \'m\', ch3 =3D 110 \'n\', ch4 =3D 111 \'o\', ch5 =3D 112 \'p\'\}, int_char= _combo=3D\{int1 =3D 123, ch1 =3D 122 \'z\'\}, d1=3D\{double1 =3D 10.5\}, d2= =3D\{double1 =3D -3.375\}, d3=3D\{double1 =3D 675.09375\}, f1=3D\{float1 = =3D 45.2340012, float2 =3D 43.5999985\}, f2=3D\{float1 =3D 78.0100021, floa= t2 =3D 122.099998\}, f3=3D\{float1 =3D -1232.34497, float2 =3D -199.210007\= }\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.= *$gdb_prompt $" {pass "step into print_long_arg_list"} - -re ".*$gdb_prompt $" { fail "step into print_long_arg_list" } - timeout { fail "step into print_long_arg_list (timeout)" } - } + gdb_test "step" \ + "print_long_arg_list.*\\(a=3D22.25, b=3D33.375, c=3D0, d=3D-25, e=3D100, = f=3D2345, struct1=3D\{value =3D 6, head =3D 0\}, struct2=3D\{value =3D 10, = head =3D 0\}, struct3=3D\{value =3D 12, head =3D 0\}, struct4=3D\{value =3D= 14, head =3D 0\}, flags=3D\{alpha =3D 1, beta =3D 0, gamma =3D 1, delta = =3D 0, epsilon =3D 1, omega =3D 0\}, flags_combo=3D\{alpha =3D 1, beta =3D = 0, ch1 =3D 121 \'y\', gamma =3D 1, delta =3D 0, ch2 =3D 110 \'n\', epsilon = =3D 1, omega =3D 0\}, three_char=3D\{ch1 =3D 97 \'a\', ch2 =3D 98 \'b\', ch= 3 =3D 99 \'c\'\}, five_char=3D\{ch1 =3D 108 \'l\', ch2 =3D 109 \'m\', ch3 = =3D 110 \'n\', ch4 =3D 111 \'o\', ch5 =3D 112 \'p\'\}, int_char_combo=3D\{i= nt1 =3D 123, ch1 =3D 122 \'z\'\}, d1=3D\{double1 =3D 10.5\}, d2=3D\{double1= =3D -3.375\}, d3=3D\{double1 =3D 675.09375\}, f1=3D\{float1 =3D 45.2340012= , float2 =3D 43.5999985\}, f2=3D\{float1 =3D 78.0100021, float2 =3D 122.099= 998\}, f3=3D\{float1 =3D -1232.34497, float2 =3D -199.210007\}\\) at .*${sr= cfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);" \ + "step into print_long_arg_list" } else { =20 # We can't just assume that a "step" will get us into @@ -472,21 +419,20 @@ if { [istarget "hppa*-*-hpux*"] } { # The short match case below handles cases where a buffer # overflows or something, and expect can't deal with the full # line. Perhaps a more elegant solution exists... -sts 1999-08-17 - send_gdb "continue\n" if {![gdb_skip_float_test "step into print_long_arg_list"]} { - gdb_expect { - -re ".*print_long_arg_list \\(a=3D22.25, b=3D33.375, c=3D0, d=3D-25, = e=3D100, f=3D2345, struct1=3D\{value =3D 6, head =3D 0\}, struct2=3D\{value= =3D 10, head =3D 0\}, struct3=3D\{value =3D 12, head =3D 0\}, struct4=3D\{= value =3D 14, head =3D 0\}, flags=3D\{alpha =3D 1, beta =3D 0, gamma =3D 1,= delta =3D 0, epsilon =3D 1, omega =3D 0\}, flags_combo=3D\{alpha =3D 1, be= ta =3D 0, ch1 =3D 121 \'y\', gamma =3D 1, delta =3D 0, ch2 =3D 110 \'n\', e= psilon =3D 1, omega =3D 0\}, three_char=3D\{ch1 =3D 97 \'a\', ch2 =3D 98 \'= b\', ch3 =3D 99 \'c\'\}, five_char=3D\{ch1 =3D 108 \'l\', ch2 =3D 109 \'m\'= , ch3 =3D 110 \'n\', ch4 =3D 111 \'o\', ch5 =3D 112 \'p\'\}, int_char_combo= =3D\{int1 =3D 123, ch1 =3D 122 \'z\'\}, d1=3D\{double1 =3D 10.5\}, d2=3D\{d= ouble1 =3D -3.375\}, d3=3D\{double1 =3D 675.09375\}, f1=3D\{float1 =3D 45.2= 340012, float2 =3D 43.5999985\}, f2=3D\{float1 =3D 78.0100021, float2 =3D 1= 22.099998\}, f3=3D\{float1 =3D -1232.34497, float2 =3D -199.210007\}\\) at = .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_pr= ompt $" { pass "step into print_long_arg_list" } - -re ".*print_long_arg_list.*\\(a=3D22.25, b=3D33.375, c=3D0, d=3D-25,= e=3D100, f=3D2345, struct1=3D\{value =3D 6, head =3D 0\}, struct2=3D\{valu= e =3D 10, head =3D 0\}, struct3=3D\{value =3D 12, head =3D 0\}, struct4=3D\= {value =3D 14, head =3D 0\}, flags=3D\{alpha =3D 1, beta =3D 0, gamma =3D 1= , delta =3D 0, epsilon =3D 1, omega =3D 0\}, flags_combo=3D\{alpha =3D 1, b= eta =3D 0, ch1 =3D 121 \'y\', gamma =3D 1, delta =3D 0, ch2 =3D 110 \'n\', = epsilon =3D 1, omega =3D 0\}, three_char=3D\{ch1 =3D 97 \'a\', ch2 =3D 98 \= 'b\', ch3 =3D 99 \'c\'\}.*\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf= \\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_li= st (short match)"} - -re ".*$gdb_prompt $" { fail "step into print_long_arg_list" } - timeout { fail "step into print_long_arg_list (timeout)" } + gdb_test_multiple "continue" "step into print_long_arg_list" { + -re ".*print_long_arg_list \\(a=3D22.25, b=3D33.375, c=3D0, d=3D-25, = e=3D100, f=3D2345, struct1=3D\{value =3D 6, head =3D 0\}, struct2=3D\{value= =3D 10, head =3D 0\}, struct3=3D\{value =3D 12, head =3D 0\}, struct4=3D\{= value =3D 14, head =3D 0\}, flags=3D\{alpha =3D 1, beta =3D 0, gamma =3D 1,= delta =3D 0, epsilon =3D 1, omega =3D 0\}, flags_combo=3D\{alpha =3D 1, be= ta =3D 0, ch1 =3D 121 \'y\', gamma =3D 1, delta =3D 0, ch2 =3D 110 \'n\', e= psilon =3D 1, omega =3D 0\}, three_char=3D\{ch1 =3D 97 \'a\', ch2 =3D 98 \'= b\', ch3 =3D 99 \'c\'\}, five_char=3D\{ch1 =3D 108 \'l\', ch2 =3D 109 \'m\'= , ch3 =3D 110 \'n\', ch4 =3D 111 \'o\', ch5 =3D 112 \'p\'\}, int_char_combo= =3D\{int1 =3D 123, ch1 =3D 122 \'z\'\}, d1=3D\{double1 =3D 10.5\}, d2=3D\{d= ouble1 =3D -3.375\}, d3=3D\{double1 =3D 675.09375\}, f1=3D\{float1 =3D 45.2= 340012, float2 =3D 43.5999985\}, f2=3D\{float1 =3D 78.0100021, float2 =3D 1= 22.099998\}, f3=3D\{float1 =3D -1232.34497, float2 =3D -199.210007\}\\) at = .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_pr= ompt $" { + pass "step into print_long_arg_list" + } + -re ".*print_long_arg_list.*\\(a=3D22.25, b=3D33.375, c=3D0, d=3D-25,= e=3D100, f=3D2345, struct1=3D\{value =3D 6, head =3D 0\}, struct2=3D\{valu= e =3D 10, head =3D 0\}, struct3=3D\{value =3D 12, head =3D 0\}, struct4=3D\= {value =3D 14, head =3D 0\}, flags=3D\{alpha =3D 1, beta =3D 0, gamma =3D 1= , delta =3D 0, epsilon =3D 1, omega =3D 0\}, flags_combo=3D\{alpha =3D 1, b= eta =3D 0, ch1 =3D 121 \'y\', gamma =3D 1, delta =3D 0, ch2 =3D 110 \'n\', = epsilon =3D 1, omega =3D 0\}, three_char=3D\{ch1 =3D 97 \'a\', ch2 =3D 98 \= 'b\', ch3 =3D 99 \'c\'\}.*\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf= \\(\"double :.*\", a\\);.*$gdb_prompt $" { + pass "step into print_long_arg_list (short match)" + } } } else { # If skipping float tests, don't expect anything in arg list. - gdb_expect { - -re ".*print_long_arg_list \\(.*\\).*$gdb_prompt $" { pass "step into= print_long_arg_list" } - -re ".*$gdb_prompt $" { fail "step into print_long_arg_list" } - timeout { fail "step into print_long_arg_list (timeout)" } - } + gdb_test "continue" \ + "print_long_arg_list \\(.*\\).*" \ + "step into print_long_arg_list" } } =20 @@ -558,29 +504,15 @@ if ![gdb_skip_stdio_test "continuing to=20 } =20 #step - send_gdb "step\n" - gdb_expect { - -re " -init_bit_flags_combo \\(bit_flags_combo=3D, a=3D1, b=3D0, ch1=3D121 .y., g= =3D1, d=3D0, ch2=3D110 .n., e=3D1, o=3D0\\) at .*call-ar-st.c:416\[ \t\n\r\= ]+416.*bit_flags_combo->alpha =3D a;.*$gdb_prompt $" { - pass "step into init_bit_flags_combo"} - -re ".*$gdb_prompt $" { fail "step into init_bit_flags_combo" } - timeout { fail "step into init_bit_flags_combo (timeout)" } - } +gdb_test "step" \ + "init_bit_flags_combo \\(bit_flags_combo=3D, a=3D1, b=3D0, ch1=3D121 .= y., g=3D1, d=3D0, ch2=3D110 .n., e=3D1, o=3D0\\) at .*call-ar-st.c:416\[ \t= \n\r\]+416.*bit_flags_combo->alpha =3D a;" \ + "step into init_bit_flags_combo" =20 #call print_bit_flags_combo(*bit_flags_combo) if ![gdb_skip_stdio_test "continuing to 1300"] { - send_gdb "print print_bit_flags_combo(*bit_flags_combo)\n" - gdb_expect { - -re ".*alpha.*gamma.*epsilon.*ch1: y.*ch2: n.*$gdb_prompt $" { - pass "print print_bit_flags_combo from init_bit_flags_combo" - } - -re ".*$gdb_prompt $" { - fail "print print_bit_flags_combo from init_bit_flags_combo"=20 - } - timeout { - fail "(timeout) print_bit_flags_combo from init_bit_flags_combo"=20 - } - } + gdb_test "print print_bit_flags_combo(*bit_flags_combo)" \ + "alpha.*gamma.*epsilon.*ch1: y.*ch2: n.*" \ + "print print_bit_flags_combo from init_bit_flags_combo" } =20 =20 @@ -655,18 +587,9 @@ gdb_test continue "Continuing\\..*main \ =20 #call sum_struct_print(10, *struct1, *struct2, *struct3, *struct4) if ![gdb_skip_stdio_test "print sum_struct_print(...)"] { - send_gdb "print sum_struct_print(10, *struct1, *struct2, *struct3, *st= ruct4)\n" - gdb_expect { - -re ".*Sum of the 4 struct values and seed :\[ \t\n\r\]+218.*$gdb_prompt = $" { - pass "print sum_struct_print(10, *struct1, *struct2, *struct3, *struc= t4)" - } - -re ".*$gdb_prompt $" {=20 - fail "print sum_struct_print(10, *struct1, *struct2, *struct3, *struc= t4)"=20 - } - timeout {=20 - fail "(timeout) sum_struct_print(10, *struct1, *struct2, *struct3, *s= truct4)"=20 - } - } + gdb_test "print sum_struct_print(10,*struct1,*struct2,*struct3,*struct= 4)" \ + "Sum of the 4 struct values and seed :\[ \t\n\r\]+218.*" \ + "print sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)" } =20 =20 @@ -685,18 +608,9 @@ if ![gdb_skip_stdio_test "print print_st } =20 if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] { - send_gdb "print print_one_large_struct(*list1)\n" - gdb_expect { - -re ".* 4 1.*$gdb_prompt $" { - pass "print print_one_large_struct(*list1)" - } - -re ".*$gdb_prompt $" { - fail "print print_one_large_struct(*list1)" - } - timeout { - fail "(timeout) print_one_large_struct(*list1)" - } - } + gdb_test "print print_one_large_struct(*list1)" \ + " 4 1.*" \ + "print print_one_large_struct(*list1)" } =20 set timeout $oldtimeout Index: callfuncs.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.exp,v retrieving revision 1.34 diff -u -p -r1.34 callfuncs.exp --- callfuncs.exp 5 May 2010 18:06:57 -0000 1.34 +++ callfuncs.exp 22 May 2010 21:15:10 -0000 @@ -58,24 +58,19 @@ if [target_info exists gdb,cannot_call_f proc set_lang_c {} { global gdb_prompt =20 - send_gdb "set language c\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "set language c (timeout)" ; return 0; } - } + gdb_test_no_output "set language c"=20 =20 - send_gdb "show language\n" - gdb_expect { + gdb_test_multiple "show language" "set language to \"c\"" { -re ".* source language is \"c\".*$gdb_prompt $" { pass "set language to \"c\"" return 1 } -re ".*$gdb_prompt $" { - fail "setting language to \"c\"" + fail "set language to \"c\"" return 0 } timeout { - fail "can't show language (timeout)" + fail "(timeout) set language to \"c\"" return 0 } } Index: call-rt-st.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-rt-st.exp,v retrieving revision 1.27 diff -u -p -r1.27 call-rt-st.exp --- call-rt-st.exp 5 May 2010 18:06:57 -0000 1.27 +++ call-rt-st.exp 22 May 2010 21:15:10 -0000 @@ -64,14 +64,9 @@ if [target_info exists gdb,cannot_call_f proc set_lang_c {} { global gdb_prompt =20 - send_gdb "set language c\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "set language c (timeout)" ; return 0; } - } + gdb_test_no_output "set language c" =20 - send_gdb "show language\n" - gdb_expect { + gdb_test_multiple "show language" "set language to \"c\"" { -re ".* source language is \"c\".*$gdb_prompt $" { pass "set language to \"c\"" return 1 @@ -93,9 +88,9 @@ 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_no_output "set print sevenbit-strings" +gdb_test_no_output "set print address off" +gdb_test_no_output "set width 0" =20 =20 if ![runto_main] then { @@ -108,29 +103,17 @@ gdb_test "break loop_count" \ "Breakpoint.* file .*call-rt-st.c, line 128\\." \ "breakpoint loop_count" =20 +gdb_test "continue" \ + "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:128\[ \= t\r\n\]+128\[\t \]+for \\(index=3D0; index.4; index..\\);\[\r\n \]+" \ + "continue to loop_count" =20 -send_gdb "continue\n" -gdb_expect { - -re "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:128\[= \t\r\n\]+128\[\t \]+for \\(index=3D0; index.4; index..\\);\[\r\n \]+$gdb_p= rompt $" { - pass "continue to loop_count"} - -re ".*$gdb_prompt $" { fail "continue to loop_count"}=20=20=20=20= =20=20=20=20=20=20=20 - timeout { fail "(timeout) continue to loop_count"} -} - -send_gdb "finish\n" -gdb_expect { - -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:128\[ = \t\r\n\]+main \\(\\) at.*call-rt-st.c:777\[ \t\r\n\]+777\[\t \]+return 0;.*= $gdb_prompt $" { +gdb_test_multiple "finish" "finish out from loop count" { + -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:128\[ \= t\r\n\]+main \\(\\) at.*call-rt-st.c:777\[ \t\r\n\]+777\[\t \]+return 0;.*$= gdb_prompt $" { pass "finish out from loop_count (line 777)" } -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:128\[ = \t\r\n\]+main \\(\\) at.*call-rt-st.c:775\[ \t\r\n\]+775\[\t \]+loop_count.= *$gdb_prompt $" { pass "finish out from loop_count (line 775)" } - -re ".*$gdb_prompt $" { - fail "finish out from loop_count" - } - timeout { - fail "finish out from loop_count (timeout)" - } } =20 # Ask GDB to print the value of EXPR, and expect to see the regexp @@ -142,20 +125,13 @@ proc print_struct_call { expr result } { global gdb_prompt =20 set command "print $expr" - send_gdb "${command}\n" - gdb_expect { + gdb_test_multiple "${command}" "${command}" { -re "$result\[\r\n\]+$gdb_prompt $" { pass "$command" } -re "Function return value unknown.\[\r\n\]+$gdb_prompt $" { unsupported "$command" } - -re "$gdb_prompt $" { - fail "$command" - } - timeout { - fail "$command (timeout)" - } } } =20 Index: call-signal-resume.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-signal-resume.exp,v retrieving revision 1.4 diff -u -p -r1.4 call-signal-resume.exp --- call-signal-resume.exp 5 May 2010 18:06:57 -0000 1.4 +++ call-signal-resume.exp 22 May 2010 21:15:10 -0000 @@ -53,24 +53,20 @@ if [target_info exists gdb,cannot_call_f } =20 proc get_dummy_frame_number { } { - global gdb_prompt + global gdb_prompt =20 - send_gdb "bt\n" - gdb_expect { - -re "#(\[0-9\]*) *.*$gdb_prompt $" - { - return $expect_out(1,string) - } - -re "$gdb_prompt $" - { - return "" - } - timeout - { - return "" - } - } - return "" + gdb_test_multiple "bt" "backtrace" { + -re "#(\[0-9\]*) *.*$gdb_prompt $" { + return $expect_out(1,string) + } + -re "$gdb_prompt $" { + return "" + } + timeout { + return "" + } + } + return "" } =20 # Start with a fresh gdb. Index: call-strs.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-strs.exp,v retrieving revision 1.15 diff -u -p -r1.15 call-strs.exp --- call-strs.exp 5 May 2010 18:06:57 -0000 1.15 +++ call-strs.exp 22 May 2010 21:15:10 -0000 @@ -58,24 +58,19 @@ if [target_info exists gdb,cannot_call_f proc set_lang_c {} { global gdb_prompt =20 - send_gdb "set language c\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "set language c (timeout)" ; return 0; } - } + gdb_test_no_output "set language c" =20 - send_gdb "show language\n" - gdb_expect { + gdb_test_multiple "show language" "set language to c" { -re ".* source language is \"c\".*$gdb_prompt $" { pass "set language to \"c\"" return 1 } -re ".*$gdb_prompt $" { - fail "setting language to \"c\"" + fail "set language to \"c\"" return 0 } timeout { - fail "can't show language (timeout)" + fail "(timeout) set language to \"c\"" return 0 } } @@ -89,9 +84,9 @@ 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_no_output "set print sevenbit-strings" +gdb_test_no_output "set print address off" +gdb_test_no_output "set width 0" =20 if ![runto_main] then { perror "couldn't run to breakpoint" @@ -102,163 +97,81 @@ set prev_timeout $timeout set timeout 120 =20 #step -send_gdb "step\n" -gdb_expect { - -re ".*strcpy\\(buf, \"test string\"\\);.*$gdb_prompt $" {pass "st= ep after assignment to s"} - -re ".*$gdb_prompt $" { fail "step after assignment to s" } - timeout { fail "step after assignment to s (timeout)" } - } - +gdb_test "step" \ + "strcpy\\(buf, \"test string\"\\);" \ + "step after assignment to s" =20 #next -send_gdb "next\n" -gdb_expect { - -re ".*str_func\\(\"abcd\", \"efgh\", \"ijkl\", \"mnop\", \"qrst\"= , \"uvwx\", \"yz12\"\\);.*$gdb_prompt $" {pass "next over strcpy"} - -re ".*$gdb_prompt $" { fail "next over strcpy" } - timeout { fail "next over strcpy (timeout)" } - } +gdb_test "next" \ + "str_func\\(\"abcd\", \"efgh\", \"ijkl\", \"mnop\", \"qrst\", \"uvwx\"= , \"yz12\"\\);" \ + "next over strcpy" =20 #print buf -send_gdb "print buf\n" -gdb_expect { - -re ".*\"test string\",.*repeats 88 times.*$gdb_prompt $" { - pass "print buf" - } - -re ".*$gdb_prompt $" { fail "print buf" } - timeout { fail "(timeout) print buf" } - } - +gdb_test "print buf" \ + "\"test string\",.*repeats 88 times.*" =20 #print s -send_gdb "print s\n" -gdb_expect { - -re ".*=3D \"test string\".*$gdb_prompt $" { - pass "print s" - } - -re ".*$gdb_prompt $" { fail "print s" } - timeout { fail "(timeout) print sum_array_print(10, *list1, = *list2, *list3, *list4)" } - } - +gdb_test "print s" \ + " =3D \"test string\".*" =20 #print str_func1(s) if ![gdb_skip_stdio_test "print str_func1(s)"] { - send_gdb "print str_func1(s)\n" - gdb_expect { - -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" { - pass "print str_func1(s)" - } - -re ".*$gdb_prompt $" { fail "print str_func1(s)" } - timeout { fail "(timeout) print str_func1(s)" } - } + gdb_test "print str_func1(s)" \ + "first string arg is: test string.*\"test string\".*" } =20 - #print str_func1("test string") if ![gdb_skip_stdio_test "print str_func1(teststring)"] { - send_gdb "print str_func1(\"test string\")\n" - gdb_expect { - -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" { - pass "print str_func1(\"test string\")" - } - -re ".*$gdb_prompt $" { fail "print str_func1(\"test string\")" } - timeout { fail "(timeout) print str_func1(\"test string\")" } - } + gdb_test "print str_func1(\"test string\")" \ + "first string arg is: test string.*\"test string\".*" } =20 #call str_func1(s) if ![gdb_skip_stdio_test "call str_func1(s)"] { - send_gdb "call str_func1(s)\n" - gdb_expect { - -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" { - pass "call str_func1(s)" - } - -re ".*$gdb_prompt $" { fail "call str_func1(s)" } - timeout { fail "(timeout) call str_func1(s)" } - } + gdb_test "call str_func1(s)" \ + "first string arg is: test string.*\"test string\".*" } =20 #call str_func1("test string") if ![gdb_skip_stdio_test "call str_func1 (...)"] { - send_gdb "call str_func1(\"test string\")\n" - gdb_expect { - -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" { - pass "call str_func1(\"test string\")" - } - -re ".*$gdb_prompt $" { fail "call str_func1(\"test string\")" } - timeout { fail "(timeout) call str_func1(\"test string\")" } - } + gdb_test "call str_func1(\"test string\")" \ + "first string arg is: test string.*\"test string\".*" } =20 #print str_func1(buf) if ![gdb_skip_stdio_test "print str_func1(buf)"] { - send_gdb "print str_func1(buf)\n" - gdb_expect { - -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" { - pass "print str_func1(buf)" - } - -re ".*$gdb_prompt $" { fail "print str_func1(buf)" } - timeout { fail "(timeout) print str_func1(buf)" } - } + gdb_test "print str_func1(buf)" \ + "first string arg is: test string.*\"test string\".*" } =20 #call str_func1(buf) if ![gdb_skip_stdio_test "call str_func1(buf)"] { - send_gdb "call str_func1(buf)\n" - gdb_expect { - -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" { - pass "call str_func1(buf)" - } - -re ".*$gdb_prompt $" { fail "call str_func1(buf)" } - timeout { fail "(timeout) call str_func1(buf)" } - } + gdb_test "call str_func1(buf)" \ + "first string arg is: test string.*\"test string\".*" } =20 #print str_func("a","b","c","d","e","f","g") if ![gdb_skip_stdio_test "print str_func(a,b,c,d,e,f,g)"] { - send_gdb "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")\n" - gdb_expect { - -re "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]= +third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth= string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh stri= ng arg is: g\[ \t\r\n\]+.*=3D \"abcdefg\".*$gdb_prompt $" { - pass "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" - } - -re ".*$gdb_prompt $" { fail "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\= ",\"f\",\"g\")" } - timeout { fail "(timeout) print str_func(\"a\",\"b\",\"c\",\"d\= ",\"e\",\"f\",\"g\")" } - } + gdb_test "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" \ + "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+thi= rd string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth str= ing arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string a= rg is: g\[ \t\r\n\]+.*=3D \"abcdefg\".*" } =20 #call str_func("a","b","c","d","e","f","g") if ![gdb_skip_stdio_test "call str_func(a,b,c,d,e,f,g)"] { - send_gdb "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")\n" - gdb_expect { - -re "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]= +third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth= string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh stri= ng arg is: g\[ \t\r\n\]+.*=3D \"abcdefg\".*$gdb_prompt $" { - pass "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" - } - -re ".*$gdb_prompt $" { fail "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\"= ,\"f\",\"g\")" } - timeout { fail "(timeout) call str_func(\"a\",\"b\",\"c\",\"d\"= ,\"e\",\"f\",\"g\")" } - } + gdb_test "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" \ + "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+thi= rd string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth str= ing arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string a= rg is: g\[ \t\r\n\]+.*=3D \"abcdefg\".*" } =20 #print str_func(s,s,s,s,s,s,s) if ![gdb_skip_stdio_test "print str_func(s,s,s,s,s,s,s,s)"] { - send_gdb "print str_func(s,s,s,s,s,s,s)\n" - gdb_expect { - -re "first string arg is: test string\[ \t\r\n\]+second string arg is: te= st string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth str= ing arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\= n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test= string\[ \t\r\n\]+.*\"test stringtest stringtest stringtest stringtest str= ingtest stringtest string\".*$gdb_prompt $" { - pass "print str_func(s,s,s,s,s,s,s)" - } - -re ".*$gdb_prompt $" { fail "print str_func(s,s,s,s,s,s,s)" } - timeout { fail "(timeout) print str_func(s,s,s,s,s,s,s)" } - } + gdb_test "print str_func(s,s,s,s,s,s,s)" \ + "first string arg is: test string\[ \t\r\n\]+second string arg is: test s= tring\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string = arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+= sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test str= ing\[ \t\r\n\]+.*\"test stringtest stringtest stringtest stringtest stringt= est stringtest string\".*" } =20 #call str_func(s,s,s,s,s,s,s) if ![gdb_skip_stdio_test "call str_func(s,s,s,s,s,s,s,s)"] { - send_gdb "call str_func(s,s,s,s,s,s,s)\n" - gdb_expect { - -re "first string arg is: test string\[ \t\r\n\]+second string arg is: te= st string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth str= ing arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\= n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test= string\[ \t\r\n\]+.*\"test stringtest stringtest stringtest stringtest str= ingtest stringtest string\".*$gdb_prompt $" { - pass "call str_func(s,s,s,s,s,s,s)" - } - -re ".*$gdb_prompt $" { fail "call str_func(s,s,s,s,s,s,s)" } - timeout { fail "(timeout) call str_func(s,s,s,s,s,s,s)" } - } + gdb_test "call str_func(s,s,s,s,s,s,s)" \ + "first string arg is: test string\[ \t\r\n\]+second string arg is: test s= tring\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string = arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+= sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test str= ing\[ \t\r\n\]+.*\"test stringtest stringtest stringtest stringtest stringt= est stringtest string\".*" } =20 gdb_exit Index: catch-syscall.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/catch-syscall.exp,v retrieving revision 1.6 diff -u -p -r1.6 catch-syscall.exp --- catch-syscall.exp 5 May 2010 18:06:57 -0000 1.6 +++ catch-syscall.exp 22 May 2010 21:15:10 -0000 @@ -278,15 +278,7 @@ proc do_syscall_tests {} { global gdb_prompt srcdir =20 # First, we need to set GDB datadir. - send_gdb "set data-directory $srcdir/..\n" - gdb_expect 10 { - -re "$gdb_prompt $" { - verbose "Setting GDB datadir to $srcdir/..." 2 - } - timeout { - error "Couldn't set GDB datadir." - } - } + gdb_test_no_output "set data-directory $srcdir/.." =20 # Verify that the 'catch syscall' help is available set thistest "help catch syscall" Index: charset.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/charset.exp,v retrieving revision 1.23 diff -u -p -r1.23 charset.exp --- charset.exp 5 May 2010 18:06:57 -0000 1.23 +++ charset.exp 22 May 2010 21:15:10 -0000 @@ -374,15 +374,7 @@ foreach target_charset $charset_subset { set param target-charset set L "" } - send_gdb "set $param $target_charset\n"=20 - gdb_expect { - -re "$gdb_prompt $" { - pass "set $param $target_charset" - } - timeout { - fail "set $param $target_charset (timeout)" - } - } + gdb_test_no_output "set $param $target_charset" =20 # Try printing the null character. There seems to be a bug in # gdb_test that requires us to use gdb_expect here. Index: checkpoint.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/checkpoint.exp,v retrieving revision 1.13 diff -u -p -r1.13 checkpoint.exp --- checkpoint.exp 5 May 2010 18:06:57 -0000 1.13 +++ checkpoint.exp 22 May 2010 21:15:10 -0000 @@ -337,18 +337,9 @@ gdb_load ${binfile} runto_main gdb_breakpoint $break1_loc =20 -send_gdb "commands\n" -send_gdb " silent\n" -send_gdb " if (lines % 2)\n" -send_gdb " checkpoint\n" -send_gdb " end\n" -send_gdb " continue\n" -send_gdb "end\n" - -gdb_expect { - -re ".*$gdb_prompt $" { pass "set checkpoint breakpoint" } - timeout { fail "(timeout) set checkpoint breakpoint" } -} +gdb_test "commands\nsilent\nif (lines % 2)\ncheckpoint\nend\n continue\ne= nd" \ + "" \ + "set checkpoint breakpoint" =20 set prev_timeout $timeout set timeout [expr $timeout + 120] Index: commands.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/commands.exp,v retrieving revision 1.34 diff -u -p -r1.34 commands.exp --- commands.exp 5 May 2010 18:06:57 -0000 1.34 +++ commands.exp 22 May 2010 21:15:10 -0000 @@ -136,15 +136,13 @@ proc if_while_breakpoint_command_test {} delete_breakpoints gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #1" =20 - send_gdb "commands\n" - gdb_expect { - -re "End with" { - pass "commands in if_while_breakpoint_command_test" - } - default { - fail "(timeout or eof) commands in if_while_breakpoint_command_test" + gdb_test_multiple "commands" \ + "commands in if_while_breakpoint_command_test" { + -re "End with" { + pass "commands in if_while_breakpoint_command_test" + } } - } + # This test should alternate between 0xdeadbeef and 0xfeedface two tim= es. gdb_test "while value > 0\nset value -=3D 1\nif \(value % 2\) =3D=3D 1= \np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend\nend" \ "" \ @@ -182,21 +180,18 @@ proc infrun_breakpoint_command_test {} { # to get around a synchronization problem in expect. # part1: issue the gdb command "commands" # part2: send the list of commands - send_gdb "commands\n" - gdb_expect { - -re "End with" { - pass "commands in infrun_breakpoint_command_test #1" - } - default { - fail "(timeout or eof) commands in infrun_breakpoint_command_test" + gdb_test_multiple "commands" \ + "commands in infrun_breakpoint_command_test #1" { + -re "End with" { + pass "commands in infrun_breakpoint_command_test #1" + } } - } gdb_test "step\nstep\nstep\nstep\nend" "" \ "commands in infrun_breakpoint_command_test #2" =20 - gdb_test "continue" \ - "Continuing.*.*.*Breakpoint \[0-9\]*, factorial \\(value=3D5\\).*at.*\[0= -9\]*\[ \]*if \\(value > 1\\) \{.*\[0-9\]*\[ \]*value \\*=3D fact= orial \\(value - 1\\);.*" \ - "continue in infrun_breakpoint_command_test" + gdb_test "continue" \ + "Continuing.*.*.*Breakpoint \[0-9\]*, factorial \\(value=3D5\\).*at.*\[0-= 9\]*\[ \]*if \\(value > 1\\) \{.*\[0-9\]*\[ \]*value \\*=3D facto= rial \\(value - 1\\);.*" \ + "continue in infrun_breakpoint_command_test" =20 gdb_stop_suppressing_tests; } @@ -229,15 +224,13 @@ proc user_defined_command_test {} { =20 gdb_test "set \$foo =3D 4" "" "set foo in user_defined_command_test" =20 - send_gdb "define mycommand\n" - gdb_expect { - -re "End with" { - pass "define mycommand in user_defined_command_test" - } - default { - fail "(timeout or eof) define mycommand in user_defined_command_test" + gdb_test_multiple "define mycommand" \ + "define mycommand in user_defined_command_test" { + -re "End with" { + pass "define mycommand in user_defined_command_test" + } } - } + # This test should alternate between 0xdeadbeef and 0xfeedface two tim= es. gdb_test "while \$arg0 > 0\nset \$arg0 -=3D 1\nif \(\$arg0 % 2\) =3D= =3D 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend\nend" \ "" \ @@ -282,52 +275,37 @@ proc watchpoint_command_test {} { # set wp_id -1 =20 - send_gdb "watch local_var\n" - gdb_expect { - -re ".*\[Ww\]atchpoint (\[0-9\]*): local_var.*$gdb_prompt $" { + gdb_test_multiple "watch local_var" "watch local_var" { + -re "\[Ww\]atchpoint (\[0-9\]*): local_var.*$gdb_prompt $" { set wp_id $expect_out(1,string) pass "watch local_var" } - -re "$gdb_prompt $"\ - {fail "watch local_var"} - timeout {fail "(timeout) watch local_var"} } =20 if {$wp_id =3D=3D -1} {return} =20 - send_gdb "commands $wp_id\n" - gdb_expect { - -re "Type commands for breakpoint.*, one per line.*>" { - pass "begin commands on watch" - } - -re "$gdb_prompt $" {fail "begin commands on watch"} - timeout {fail "(timeout) begin commands on watch"} - } - send_gdb "print value\n" - gdb_expect { - -re ">" {pass "add print command to watch"} - -re "$gdb_prompt $" {fail "add print command to watch"} - timeout {fail "(timeout) add print command to watch"} - } - send_gdb "continue\n" - gdb_expect { - -re ">" {pass "add continue command to watch"} - -re "$gdb_prompt $" {fail "add continue command to watch"} - timeout {fail "(timeout) add continue command to watch"} + gdb_test_multiple "commands $wp_id\n" "begin commands on watch" { + -re "Type commands for breakpoint.*, one per line.*>$" { + pass "begin commands on watch" + } } - send_gdb "end\n" - gdb_expect { - -re "$gdb_prompt $" {pass "end commands on watch"} - timeout {fail "(timeout) end commands on watch"} + gdb_test_multiple "print value" "add print command to watch" { + -re ">$" { + pass "add print command to watch" + } } - send_gdb "continue\n" - gdb_expect { - -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has l= eft the block in.*which its expression is valid.*run.c:(57|82).*$gdb_prompt= $" { - pass "continue with watch" + gdb_test_multiple "continue" "add continue command to watch" { + -re ">$" { + pass "add continue command to watch" } - -re "$gdb_prompt $" {fail "continue with watch"} - timeout {fail "(timeout) continue with watch"} } + gdb_test "end" \ + "" \ + "end commands on watch" + + gdb_test "continue" \ + "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left = the block in.*which its expression is valid.*run.c:(57|82).*" \ + "continue with watch" } =20 proc test_command_prompt_position {} { @@ -448,41 +426,35 @@ proc bp_deleted_in_command_test {} { "Breakpoint \[0-9\]+ at .*: file .*/run.c, line \[0-9\]+\." \ "breakpoint in bp_deleted_in_command_test" =20=20=20=20=20 - send_gdb "commands\n" - gdb_expect { - -re "Type commands for breakpoint.*>" { + gdb_test_multiple "commands" "begin commands in bp_deleted_in_command_= test" { + -re "Type commands for breakpoint.*>$" { pass "begin commands in bp_deleted_in_command_test" } - -re "$gdb_prompt $" {fail "begin commands in bp_deleted_in_command_t= est"} - timeout {fail "(timeout) begin commands bp_deleted_in_co= mmand_test"} } - send_gdb "silent\n" - gdb_expect { - -re ">" {pass "add silent command"} - -re "$gdb_prompt $" {fail "add silent command"} - timeout {fail "(timeout) add silent command"} + gdb_test_multiple "silent" "add silent command" { + -re ">$" { + pass "add silent command" + } } - send_gdb "clear factorial\n" - gdb_expect { - -re ">" {pass "add clear command"} - -re "$gdb_prompt $" {fail "add clear command"} - timeout {fail "(timeout) add clear command"} } - send_gdb "printf \"factorial command-list executed\\n\"\n" - gdb_expect { - -re ">" {pass "add printf command"} - -re "$gdb_prompt $" {fail "add printf command"} - timeout {fail "(timeout) add printf command"} + gdb_test_multiple "clear factorial" "add clear command" { + -re ">$" { + pass "add clear command" + } } - send_gdb "cont\n" - gdb_expect { - -re ">" {pass "add cont command"} - -re "$gdb_prompt $" {fail "add cont command"} - timeout {fail "(timeout) add cont command"} } - send_gdb "end\n" - gdb_expect { - -re "$gdb_prompt $" {pass "end commands"} - timeout {fail "(timeout) end commands"} + gdb_test_multiple "printf \"factorial command-list executed\\n\"" \ + "add printf command" { + -re ">$" { + pass "add printf command" + } + } + gdb_test_multiple "cont" "add cont command" { + -re ">$" { + pass "add cont command" + } } + gdb_test "end" \ + "" \ + "end commands" =20 gdb_run_cmd gdb_expect { @@ -515,36 +487,31 @@ proc temporary_breakpoint_commands {} { "Temporary breakpoint \[0-9\]+ at .*: file .*/run.c, line \[0-9\]+\."= \ "breakpoint in temporary_breakpoint_commands" =20=20=20=20=20 - send_gdb "commands\n" - gdb_expect { - -re "Type commands for breakpoint.*>" { - pass "begin commands in bp_deleted_in_command_test" + gdb_test_multiple "commands" \ + "begin commands in bp_deleted_in_command_test" { + -re "Type commands for breakpoint.*>$" { + pass "begin commands in bp_deleted_in_command_test" + } + } + gdb_test_multiple "silent" "add silent tbreak command" { + -re ">$" { + pass "add silent tbreak command" } - -re "$gdb_prompt $" {fail "begin commands in bp_deleted_in_command_test"} - timeout {fail "(timeout) begin commands bp_deleted_in_command= _test"} } - send_gdb "silent\n" - gdb_expect { - -re ">" {pass "add silent tbreak command"} - -re "$gdb_prompt $" {fail "add silent tbreak command"} - timeout {fail "(timeout) add silent tbreak command"} - } - send_gdb "printf \"factorial tbreak commands executed\\n\"\n" - gdb_expect { - -re ">" {pass "add printf tbreak command"} - -re "$gdb_prompt $" {fail "add printf tbreak command"} - timeout {fail "(timeout) add printf tbreak command"} - } - send_gdb "cont\n" - gdb_expect { - -re ">" {pass "add cont tbreak command"} - -re "$gdb_prompt $" {fail "add cont tbreak command"} - timeout {fail "(timeout) add cont tbreak command"} } - send_gdb "end\n" - gdb_expect { - -re "$gdb_prompt $" {pass "end tbreak commands"} - timeout {fail "(timeout) end tbreak commands"} - } + gdb_test_multiple "printf \"factorial tbreak commands executed\\n\"\n"= \ + "add printf tbreak command" { + -re ">$" { + pass "add printf tbreak command" + } + } + gdb_test_multiple "cont" "add cont tbreak command" { + -re ">$" { + pass "add cont tbreak command" + } + } + gdb_test "end" \ + "" \ + "end tbreak commands" =20 gdb_run_cmd gdb_expect { Index: condbreak.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/condbreak.exp,v retrieving revision 1.17 diff -u -p -r1.17 condbreak.exp --- condbreak.exp 5 May 2010 18:06:57 -0000 1.17 +++ condbreak.exp 22 May 2010 21:15:10 -0000 @@ -205,39 +205,25 @@ gdb_test "continue" "Continuing\\..*Brea # take precedence over real code. # # Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior. -send_gdb "continue\n" -gdb_expect { +gdb_test_multiple "continue" "run until breakpoint at marker1" { -re "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile= 1:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.= *$gdb_prompt $" { pass "run until breakpoint at marker1" } -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*= $srcfile1:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\= [\t \]+.*$gdb_prompt $" { xfail "run until breakpoint at marker1" } - -re "$gdb_prompt $" { - fail "run until breakpoint at marker1" - } - timeout { - fail "(timeout) run until breakpoint at marker1" - } } =20 # run until the breakpoint at marker2 # Same issues here as above. setup_xfail hppa2.0w-*-* 11512CLLbs -send_gdb "continue\n" -gdb_expect { +gdb_test_multiple "continue" "run until breakpoint at marker2" { -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=3D43\\) at .*$sr= cfile1:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+= .*$gdb_prompt $" { pass "run until breakpoint at marker2" } -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=3D43\\) = at .*$srcfile1:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)= \[\t \]+.*$gdb_prompt $" { xfail "run until breakpoint at marker2" } - -re "$gdb_prompt $" { - fail "run until breakpoint at marker2" - } - timeout { - fail "(timeout) run until breakpoint at marker2" - } } =20 # Test combinations of conditional and thread-specific breakpoints. Index: cond-expr.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/cond-expr.exp,v retrieving revision 1.10 diff -u -p -r1.10 cond-expr.exp --- cond-expr.exp 1 Jan 2010 07:32:00 -0000 1.10 +++ cond-expr.exp 22 May 2010 21:15:10 -0000 @@ -55,57 +55,26 @@ if ![runto_main] then { continue } =20 -send_gdb "print (2 ? 3 : 4)\n" -gdb_expect { - -re ".\[0-9\]* =3D 3.*$gdb_prompt $" { - pass "print value of cond expr (const true)" - } - -re ".*$gdb_prompt $" { fail "print value of cond expr (const true)" } - timeout { fail "(timeout) print value of cond expr (const tr= ue)" } - } - -send_gdb "print (0 ? 3 : 4)\n" -gdb_expect { - -re ".\[0-9\]* =3D 4.*$gdb_prompt $" { - pass "print value of cond expr (const false)" - } - -re ".*$gdb_prompt $" { fail "print value of cond expr (const false)" } - timeout { fail "(timeout) print value of cond expr (const fa= lse)" } - } +gdb_test "print (2 ? 3 : 4)" "\[0-9\]* =3D 3" \ + "print value of cond expr (const true)" + +gdb_test "print (0 ? 3 : 4)" "\[0-9\]* =3D 4" \ + "print value of cond expr (const false)" =20 gdb_test "set variable x=3D14" "" "set variable x=3D14" gdb_test "set variable y=3D2" "" "set variable y=3D2" gdb_test "set variable z=3D3" "" "set variable z=3D3" =20 -send_gdb "print (x ? y : z)\n" -gdb_expect { - -re ".\[0-9\]* =3D 2.*$gdb_prompt $" { - pass "print value of cond expr (var true)" - } - -re ".*$gdb_prompt $" { fail "print value of cond expr (var true)" } - timeout { fail "(timeout) print value of cond expr (var true= )" } - } +gdb_test "print (x ? y : z)" "\[0-9\]* =3D 2" \ + "print value of cond expr (var true)" =20 gdb_test "set variable x=3D0" "" "set variable x=3D0" =20 -send_gdb "print (x ? y : z)\n" -gdb_expect { - -re ".\[0-9\]* =3D 3.*$gdb_prompt $" { - pass "print value of cond expr (var false)" - } - -re ".*$gdb_prompt $" { fail "print value of cond expr (var false)" } - timeout { fail "(timeout) print value of cond expr (var fals= e)" } - } - - -send_gdb "whatis (0 ? 3 : 4)\n" -gdb_expect { - -re "type =3D int.*$gdb_prompt $" { - pass "print whatis of cond expr" - } - -re ".*$gdb_prompt $" { fail "print whatis of cond expr" } - timeout { fail "(timeout) print whatis of cond expr" } - } +gdb_test "print (x ? y : z)" "\[0-9\]* =3D 3" \ + "print value of cond expr (var false)" + +gdb_test "whatis (0 ? 3 : 4)" "type =3D int" \ + "print whatis of cond expr" =20 =20 =20 Index: consecutive.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/consecutive.exp,v retrieving revision 1.12 diff -u -p -r1.12 consecutive.exp --- consecutive.exp 5 May 2010 18:06:57 -0000 1.12 +++ consecutive.exp 22 May 2010 21:15:10 -0000 @@ -60,27 +60,17 @@ gdb_test "continue" "Breakpoint $decimal set bp_addr 0 set stop_addr 0 =20 -send_gdb "x /2i \$pc\n" -gdb_expect { +gdb_test_multiple "x /2i \$pc" "get breakpoint address for foo" { -re "=3D> $hex.*${nl} ($hex).*$gdb_prompt $" { set bp_addr $expect_out(1,string) pass "get breakpoint address for foo" } - -re ".*$gdb_prompt $" { - fail "get breakpoint address for foo" - return 0; - } - timeout { - fail "get breakpoint address for foo (timeout)" - return 0; - } } =20 gdb_test "break \*$bp_addr" "Breakpoint $decimal at $bp_addr: file .*" \ "set bp, 2nd instr" =20 -send_gdb "step\n" -gdb_expect { +gdb_test_multiple "step" "stopped at bp, 2nd instr" { -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" { set stop_addr $expect_out(1,string) if [eval expr "$bp_addr =3D=3D $stop_addr"] then { @@ -89,12 +79,5 @@ gdb_expect { fail "stopped at bp, 2nd instr (wrong address)" } } - -re ".*$gdb_prompt $" { - fail "stopped at bp, 2nd instr" - } - timeout { - fail "stopped at bp, 2nd instr (timeout)" - - } } =20 Index: constvars.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/constvars.exp,v retrieving revision 1.22 diff -u -p -r1.22 constvars.exp --- constvars.exp 5 May 2010 18:06:57 -0000 1.22 +++ constvars.exp 22 May 2010 21:15:10 -0000 @@ -90,52 +90,26 @@ proc local_compiler_xfail_check_2 { } { } } =20 -send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $" +gdb_test "break marker1" "Breakpoint $decimal at .*"=20 =20 - send_gdb "cont\n" - gdb_expect { - -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" { - send_gdb "up\n" - gdb_expect { - -re ".*main.*$gdb_prompt $" { - pass "up from marker1" - } - -re ".*$gdb_prompt $" { - fail "up from marker1" - } - timeout { fail "up from marker1 (timeout)" } - } - } - -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" { - fail "continue to marker1 (demangling)" - send_gdb "up\n" - gdb_expect { - -re ".*main.*$gdb_prompt $" { - pass "up from marker1" - } - -re ".*$gdb_prompt $" { - fail "up from marker1" - } - timeout { fail "up from marker1 (timeout)" } - } - } - -re "$gdb_prompt $" { fail "continue to marker1" } - timeout { fail "(timeout) continue to marker1" } +gdb_test_multiple "cont" "up from marker1" { + -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" { + pass "continue to marker1" + gdb_test "up" " main .*" "up from marker1" } + -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" { + fail "continue to marker1 (demangling)" + gdb_test "up" " main .*" "up from marker1" + } +} =20 # test function parameters =20 local_compiler_xfail_check local_compiler_xfail_check_2 =20 -send_gdb "ptype qux1\n" -gdb_expect { - -re "type =3D int \\(const char, const char, const char \\*, char \\* = const\\).*$gdb_prompt $" { - pass "ptype qux1" - } - -re ".*$gdb_prompt $" { fail "ptype qux1" } - timeout { fail "(timeout) ptype qux1" } -}=20=20=20 +gdb_test "ptype qux1" \ + "type =3D int \\(const char, const char, const char \\*, char \\* cons= t\\).*" =20 # test vars and pointers =20 Index: corefile.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/corefile.exp,v retrieving revision 1.20 diff -u -p -r1.20 corefile.exp --- corefile.exp 5 May 2010 18:06:57 -0000 1.20 +++ corefile.exp 22 May 2010 21:15:10 -0000 @@ -123,8 +123,7 @@ gdb_load ${binfile} =20 # Test basic corefile recognition via core-file command. =20 -send_gdb "core-file $corefile\n" -gdb_expect { +gdb_test_multiple "core-file $corefile" "core-file command" { -re ".* program is being debugged already.*y or n. $" { # gdb_load may connect us to a gdbserver. send_gdb "y\n" @@ -139,8 +138,6 @@ gdb_expect { -re ".*registers from core file: File in wrong format.* $" { fail "core-file command (could not read registers from core file)" } - -re ".*$gdb_prompt $" { fail "core-file command" } - timeout { fail "(timeout) core-file command" } } =20 # Test correct mapping of corefile sections by printing some variables. --------------000901030605030503030109--