Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Andreas Arnez <arnez@linux.vnet.ibm.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 03/16] Eliminate literal line numbers in call-ar-st.exp
Date: Thu, 13 Nov 2014 13:33:00 -0000	[thread overview]
Message-ID: <87h9y3jkd1.fsf@codesourcery.com> (raw)
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")

Andreas Arnez <arnez@linux.vnet.ibm.com> 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"
>  
> -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\]+========="
>  	"\[ \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"] {
>  #  }
>  
>  #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\]+========="
> @@ -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\\(integer_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)"] && \
>      }
>  }
>  
> -#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"
>  
> -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\]+========="
>  	"\[ \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\]+.*printf\\(.BYE BYE FOR NOW.n.\\)."

Likewise.

>      }
>  } else {
>      gdb_test "continue" ".*" ""
> @@ -207,10 +209,11 @@ if ![gdb_skip_stdio_test "print sum_array_print(...)"] {
>  }
>  
>  #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)"
>  }
>  
> -#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"
>  
>  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"
>  
>  
>  # 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=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:1105\[ \t\n\r\]+1105.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
> +    ".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*$srcfile:${decimal}\[ \t\n\r\]+${decimal}.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
>  	"check args of sum_array_print"
>  

Use $stop_line instead of ${decimal}.

> @@ -359,24 +363,24 @@ if { [istarget "hppa*-*-hpux*"] } {
>      # guo 990621
>      #
>      gdb_test "step" \
> -	"print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);" \
> +	"print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:$stop_line\[\r\n\]+$stop_line\[ \t\]+printf\\(\"double :.*\", a\\);" \
>  	"step into print_long_arg_list"
>  } else {
>  
>      # 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.

-- 
Yao (齐尧)


  reply	other threads:[~2014-11-13 13:33 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 15:51 [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Andreas Arnez
2014-10-29 16:00 ` [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp Andreas Arnez
2014-10-29 16:22   ` Sergio Durigan Junior
2014-10-29 18:26     ` Andreas Arnez
2014-10-29 22:11       ` Sergio Durigan Junior
2014-10-31 20:59         ` Sergio Durigan Junior
2014-11-13 13:15   ` Yao Qi
2014-10-29 16:01 ` [PATCH 02/16] Eliminate literal line numbers in dbx.exp Andreas Arnez
2014-11-13 13:18   ` Yao Qi
2014-11-13 14:16     ` Andreas Arnez
2014-11-14  0:26       ` Yao Qi
2014-10-29 16:01 ` [PATCH 03/16] Eliminate literal line numbers in call-ar-st.exp Andreas Arnez
2014-11-13 13:33   ` Yao Qi [this message]
2014-10-29 16:01 ` [PATCH 04/16] Eliminate literal line numbers in call-rt-st.exp Andreas Arnez
2014-11-13 13:36   ` Yao Qi
2014-10-29 16:01 ` [PATCH 05/16] Eliminate literal line numbers in ending-run.exp Andreas Arnez
2014-11-13 13:44   ` Yao Qi
2014-10-29 16:02 ` [PATCH 07/16] Eliminate literal line numbers in jump.exp Andreas Arnez
2014-10-29 16:02 ` [PATCH 09/16] Eliminate literal line numbers in mi-console.exp Andreas Arnez
2014-10-29 16:02 ` [PATCH 08/16] Eliminate literal line numbers in shlib-call.exp Andreas Arnez
2014-10-29 16:02 ` [PATCH 06/16] Eliminate literal line numbers in foll-exec.exp Andreas Arnez
2014-10-29 16:03 ` [PATCH 10/16] 'callfuncs' test case: Fix typo in prototyped version Andreas Arnez
2014-10-29 16:03 ` [PATCH 12/16] Drop non-prototype C function header variants: 'break' test case Andreas Arnez
2014-10-29 16:03 ` [PATCH 11/16] Drop non-prototype C function header variants: solib1.c Andreas Arnez
2014-10-29 16:04 ` [PATCH 16/16] GDB testsuite: Fix warnings with -std=gnu11 Andreas Arnez
2014-10-29 16:04 ` [PATCH 13/16] Drop non-prototype C function header variants: 'list' test case Andreas Arnez
2014-11-12 12:33   ` Pedro Alves
2014-11-12 15:05     ` Andreas Arnez
2014-11-12 15:18       ` Pedro Alves
2014-10-29 16:04 ` [PATCH 14/16] Drop non-prototype C function header variants: 'sepdebug' " Andreas Arnez
2014-10-29 16:04 ` [PATCH 15/16] GDB testsuite: drop non-prototype C function header variants Andreas Arnez
2014-11-13 14:06 ` [PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11 Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9y3jkd1.fsf@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox