From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29181 invoked by alias); 13 Nov 2014 13:33:43 -0000 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 Received: (qmail 29171 invoked by uid 89); 13 Nov 2014 13:33:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Nov 2014 13:33:38 +0000 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1XouWl-0007Bw-5F from Yao_Qi@mentor.com ; Thu, 13 Nov 2014 05:33:35 -0800 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.181.6; Thu, 13 Nov 2014 05:33:34 -0800 From: Yao Qi To: Andreas Arnez CC: Subject: Re: [PATCH 03/16] Eliminate literal line numbers in call-ar-st.exp References: <1414597859-12523-1-git-send-email-arnez@linux.vnet.ibm.com> <1414598446-13831-3-git-send-email-arnez@linux.vnet.ibm.com> Date: Thu, 13 Nov 2014 13:33:00 -0000 In-Reply-To: <1414598446-13831-3-git-send-email-arnez@linux.vnet.ibm.com> (Andreas Arnez's message of "Wed, 29 Oct 2014 17:00:18 +0100") Message-ID: <87h9y3jkd1.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg00261.txt.bz2 Andreas Arnez writes: > gdb/testsuite/ChangeLog: > > * gdb.base/call-ar-st.c: Add eye-catchers. > * gdb.base/call-ar-st.exp: Refer to eye-catchers instead of > literal line numbers. The comments to patch 02/16 still applies here. > -#go -until 1216 > -gdb_test "tbreak 1216" \ > -"Temporary breakpoint.*file.*$srcfile, line 1216.*" \ > -"tbreakpoint line 1216" > +set stop_line [gdb_get_line_number "-tbreak2-"] > +gdb_test "tbreak $stop_line" \ > +"Temporary breakpoint.*file.*$srcfile, line $stop_line.*" \ > +"tbreakpoint at tbreak2" >=20=20 > -if ![gdb_skip_stdio_test "continue to 1216"] { > - gdb_test_sequence "continue" "continue to 1216" { > +if ![gdb_skip_stdio_test "continue to tbreak2"] { > + gdb_test_sequence "continue" "continue to tbreak2" { > "\[ \t\r\n\]+array_c :" > "\[ \t\r\n\]+=3D=3D=3D=3D=3D=3D=3D=3D=3D" > "\[ \t\r\n\]+\[ \t\r\n\]+Z" > "\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ" > "\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ" > "\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa" > - "\[ \t\r\n\]+main.*at.*:1216" > - "\[ \t\r\n\]+1216.*print_double_array\\(double_array\\)" > + "\[ \t\r\n\]+main.*at.*:\[0-9\]+" > + "\[ \t\r\n\]+\[0-9\]+.*print_double_array\\(double_array\\)" > } How about using $stop_line instead of [0-9] here? > } else { > gdb_test "continue" ".*" "" > @@ -128,14 +128,14 @@ if ![gdb_skip_stdio_test "continue to 1216"] { > # } >=20=20 > #set timeout $oldtimeout > -#go -until 1220 > -gdb_test "tbreak 1220" \ > - "Temporary breakpoint.* file .*$srcfile, line 1220.*" \ > - "tbreakpoint line 1220" > - > -if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \ > - ![gdb_skip_stdio_test "continuing to breakpoint 1220"] } { > - gdb_test_sequence "continue" "continuing to breakpoint 1220" { > +set stop_line [gdb_get_line_number "-tbreak3-"] > +gdb_test "tbreak $stop_line" \ > + "Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \ > + "tbreakpoint at tbreak3" > + > +if {![gdb_skip_float_test "continuing to tbreak3"] && \ > + ![gdb_skip_stdio_test "continuing to tbreak3"] } { > + gdb_test_sequence "continue" "continuing to tbreak3" { > "Continuing\\." > "\[ \t\r\n\]+array_d :" > "\[ \t\r\n\]+=3D=3D=3D=3D=3D=3D=3D=3D=3D" > @@ -145,21 +145,23 @@ if {![gdb_skip_float_test "continuing to breakpoint= 1220"] && \ > "array_f :" > "student id :\[\t \]+.*YELLOW" > "array_i :" > - "main \\(\\) at .*call-ar-st.c:1220\[ \t\r\n\]+.*print_all_arrays\\(int= eger_array, char_array, float_array, double_array\\)." > + "main \\(\\) at .*call-ar-st.c:\[0-9\]+\[ \t\r\n\]+.*print_all_arrays\\= (integer_array, char_array, float_array, double_array\\)." Likewise. > @@ -177,21 +179,21 @@ if {![gdb_skip_float_test "print print_double_array= (array_d)"] && \ > } > } >=20=20 > -#go -until 1236 > -gdb_test "tbreak 1236" \ > -"Temporary breakpoint.* file .*$srcfile, line 1236.*" \ > -"tbreakpoint line 1236" > +set stop_line [gdb_get_line_number "-tbreak4-"] > +gdb_test "tbreak $stop_line" \ > +"Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \ > +"tbreakpoint at tbreak4" >=20=20 > -if {![gdb_skip_float_test "continuing to 1236"] && \ > - ![gdb_skip_stdio_test "continuing to 1236"] } { > - gdb_test_sequence "continue" "continuing to 1236" { > +if {![gdb_skip_float_test "continuing to tbreak4"] && \ > + ![gdb_skip_stdio_test "continuing to tbreak4"] } { > + gdb_test_sequence "continue" "continuing to tbreak4" { > "Continuing\\..*array_c" > "array_f" > "\[ \t\r\n\]+array_d :" > "\[ \t\r\n\]+=3D=3D=3D=3D=3D=3D=3D=3D=3D" > "\[ \t\r\n\]+0.000000" > "\[ \t\r\n\]+23.456\[0-9\]* 46.913\[0-9\]* 70.370\[0-9\]* 93.826\[0-= 9\]* 117.283\[0-9\]* 140.740\[0-9\]* 164.196\[0-9\]* 187.653\[0-9\]*" > - "\[ \t\r\n\]+.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1236.*printf\= \(.BYE BYE FOR NOW.n.\\)." > + "\[ \t\r\n\]+.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:\[0-9\]+.*pri= ntf\\(.BYE BYE FOR NOW.n.\\)." Likewise. > } > } else { > gdb_test "continue" ".*" "" > @@ -207,10 +209,11 @@ if ![gdb_skip_stdio_test "print sum_array_print(...= )"] { > } >=20=20 > #step over > -if ![gdb_skip_stdio_test "next to 1237"] { > +set stop_line [gdb_get_line_number "-next2-"] > +if ![gdb_skip_stdio_test "next to next2"] { > gdb_test "next" \ > - "BYE BYE FOR NOW.*1237.*printf\\(.VERY GREEN GRASS.n.\\);.*" \ > - "next to 1237" > + "BYE BYE FOR NOW.*$stop_line.*printf\\(.VERY GREEN GRASS.n.\\);.*" \ > + "next to next2" > } else { > gdb_test "next" ".*" "" > } > @@ -223,14 +226,14 @@ if ![gdb_skip_stdio_test "print print_array_rep(...= )"] { > "print print_array_rep(*list1, *list2, *list3)" > } >=20=20 > -#go -until 1241 > -gdb_test "tbreak 1241" \ > - "Temporary breakpoint..* file .*$srcfile, line 1241.*" \ > - "tbreakpoint line 1241" > +set stop_line [gdb_get_line_number "-tbreak5-"] > +gdb_test "tbreak $stop_line" \ > + "Temporary breakpoint..* file .*$srcfile, line $stop_line.*" \ > + "tbreakpoint at tbreak5" >=20=20 > gdb_test "continue" \ > - "main \\(\\) at .*call-ar-st.c:1241\r\n1241\[\t \]+sum_array_print\\= (10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*" \ > - "continue to 1241" > + "main \\(\\) at .*$srcfile:$stop_line\r\n$stop_line\[\t \]+sum_array= _print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*" \ > + "continue to tbreak5" >=20=20 >=20=20 > # Run into sum_array_print, and verify that the arguments were passed > @@ -242,11 +245,11 @@ gdb_test "continue" \ > # may itself be a bug, but it's not the one we're trying to catch > # here. I've added something to step-test.exp for this. > gdb_test "break sum_array_print" \ > - ".*Breakpoint ${decimal}: file .*call-ar-st.c, line.*" \ > + ".*Breakpoint ${decimal}: file .*$srcfile, line.*" \ > "set breakpoint in sum_array_print" The change like this is good, but is not related to your patch. > gdb_test_no_output "set print frame-arguments all" > gdb_test "continue" \ > - ".*Breakpoint ${decimal}, sum_array_print \\(seed=3D10, linked_list1=3D= .next_index =3D .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values =3D .4, 6, 8, 10, 1= 2, 14, 16, 18, 20, 22., head =3D 0., linked_list2=3D.next_index =3D .1, 2, = 3, 4, 5, 6, 7, 8, 9, 10., values =3D .8, 10, 12, 14, 16, 18, 20, 22, 24, 26= ., head =3D 0., linked_list3=3D.next_index =3D .1, 2, 3, 4, 5, 6, 7, 8, 9, = 10., values =3D .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head =3D 0., link= ed_list4=3D.next_index =3D .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values =3D .20,= 22, 24, 26, 28, 30, 32, 34, 36, 38., head =3D 0.\\) at .*call-ar-st.c:1105= \[ \t\n\r\]+1105.*printf\\(.Sum of 4 arrays, by element \\(add in seed as w= ell\\).*\\);.*" \ > + ".*Breakpoint ${decimal}, sum_array_print \\(seed=3D10, linked_list1= =3D.next_index =3D .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values =3D .4, 6, 8, 10= , 12, 14, 16, 18, 20, 22., head =3D 0., linked_list2=3D.next_index =3D .1, = 2, 3, 4, 5, 6, 7, 8, 9, 10., values =3D .8, 10, 12, 14, 16, 18, 20, 22, 24,= 26., head =3D 0., linked_list3=3D.next_index =3D .1, 2, 3, 4, 5, 6, 7, 8, = 9, 10., values =3D .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head =3D 0., l= inked_list4=3D.next_index =3D .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values =3D .= 20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head =3D 0.\\) at .*$srcfile:${dec= imal}\[ \t\n\r\]+${decimal}.*printf\\(.Sum of 4 arrays, by element \\(add i= n seed as well\\).*\\);.*" \ > "check args of sum_array_print" >=20=20 Use $stop_line instead of ${decimal}. > @@ -359,24 +363,24 @@ if { [istarget "hppa*-*-hpux*"] } { > # guo 990621 > # > 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\', c= h3 =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\\);" \ > + "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\', c= h3 =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}:$stop_line\[\r\n\]+$stop_line\[ \t\]+printf\\(\"double :.*\", a\\);"= \ > "step into print_long_arg_list" > } else { >=20=20 > # We can't just assume that a "step" will get us into > # print_long_arg_list here,either. > gdb_test "tbreak print_long_arg_list" \ > - "Temporary breakpoint .* file .*call-ar-st.c, line .*" \ > + "Temporary breakpoint .* file .*$srcfile, line .*" \ Again, the change is good, but isn't related to your patch. It should be moved to a separate patch. --=20 Yao (=E9=BD=90=E5=B0=A7)