From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp
Date: Wed, 29 Oct 2014 18:26:00 -0000 [thread overview]
Message-ID: <87h9ymag24.fsf@br87z6lw.de.ibm.com> (raw)
In-Reply-To: <87bnoukfql.fsf@redhat.com> (Sergio Durigan Junior's message of "Wed, 29 Oct 2014 12:22:42 -0400")
Hi Sergio,
Thanks for reviewing!
On Wed, Oct 29 2014, Sergio Durigan Junior wrote:
> On Wednesday, October 29 2014, Andreas Arnez wrote:
>
> [...]
>> diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp
>> index 073c3df..03d10a5 100644
>> --- a/gdb/testsuite/gdb.base/so-impl-ld.exp
>> +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
>> @@ -61,12 +61,12 @@ gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \
>>
>> # Verify that we can step into the second shlib call.
>> #
>> -gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \
>> +gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \
>> "step into solib call"
>
> Can't you use ${decimal} here, instead of expecting anything?
Certainly.
>
>> # Verify that we can step within the shlib call.
>> #
>> -gdb_test "next" "18\[ \t\]*\}" "step in solib call"
>> +gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call"
>
> Same here: ${decimal} is made to replace this \[0-9\]+.
Good point. Changed both as suggested. Also replaced \[0-9\]+ by
${decimal} in the patches for dbx.exp, call-ar-st.exp, call-rt-st.exp,
jump.exp, and shlib-call.exp. While reviewing again I also noticed that
I introduced an excess ".*" in front of a regexp in foll-exec.exp and
removed it.
Note that some regexps are currently enclosed in a brace-quoted group,
where variables are not substituted -- particularly in the various uses
of gdb_test_sequence in call-ar-st.exp. There I still use \[0-9\]+, to
avoid larger modifications to the existing regexps.
Here are the changes I performed based on your suggestion:
--- a/gdb/testsuite/gdb.base/call-ar-st.exp
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -62,7 +62,7 @@
set stop_line [gdb_get_line_number "-tbreak1-"]
gdb_test "tbreak $stop_line" \
- "Temporary breakpoint \[0-9\]+.*file.*$srcfile, line $stop_line.*" \
+ "Temporary breakpoint ${decimal}.*file.*$srcfile, line $stop_line.*" \
"tbreakpoint at tbreak1"
gdb_test continue \
--- a/gdb/testsuite/gdb.base/call-rt-st.exp
+++ b/gdb/testsuite/gdb.base/call-rt-st.exp
@@ -74,10 +74,10 @@
"continue to loop_count"
gdb_test_multiple "finish" "finish out from loop count" {
- -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+return 0;.*-finish1-.*$gdb_prompt $" {
+ -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:${decimal}\[ \t\r\n\]+${decimal}\[\t \]+return 0;.*-finish1-.*$gdb_prompt $" {
pass "finish out from loop_count (finish1)"
}
- -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" {
+ -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:${decimal}\[ \t\r\n\]+${decimal}\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" {
pass "finish out from loop_count (line 775)"
}
}
--- a/gdb/testsuite/gdb.base/dbx.exp
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -289,6 +289,7 @@
#test_func
#
proc test_func { } {
+ global decimal
global srcfile2
gdb_test "cont" ".*" "cont 1"
gdb_test "step" ".*"
@@ -300,7 +301,7 @@
gdb_test "cont" ".*" "cont 2"
# This always fails, but it's not clear why. -sts 1999-08-17
setup_xfail "*-*-*"
- gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:\[0-9\]+\r\n\[0-9\]+\[ \t\]+total = sum\\(list, low, high\\);"
+ gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:${decimal}\r\n\${decimal}\[ \t\]+total = sum\\(list, low, high\\);"
}
# Start with a fresh gdb.
--- a/gdb/testsuite/gdb.base/foll-exec.exp
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -119,7 +119,7 @@
#
send_gdb "next 3\n"
gdb_expect {
- -re ".*execlp \\(.*$gdb_prompt $"\
+ -re "execlp \\(.*$gdb_prompt $"\
{pass "step to exec call"}
-re "$gdb_prompt $" {fail "step to exec call"}
timeout {fail "(timeout) step to exec call"}
--- a/gdb/testsuite/gdb.base/jump.exp
+++ b/gdb/testsuite/gdb.base/jump.exp
@@ -40,7 +40,7 @@
set bp_on_non_call 0
set non_call_line [gdb_get_line_number "bp-on-non-call"]
gdb_test_multiple "break $non_call_line" "break before jump to non-call" {
- -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line $non_call_line.*$gdb_prompt $" {
+ -re "\[Bb\]reakpoint (${decimal}) at ${hex}: file .*${srcfile}, line $non_call_line.*$gdb_prompt $" {
set bp_on_non_call $expect_out(1,string)
pass "break before jump to non-call"
}
@@ -48,7 +48,7 @@
# Can we jump to the statement? Do we stop there?
#
-gdb_test "jump $non_call_line" "Breakpoint \[0-9\]*, .*${srcfile}:$non_call_line.*" \
+gdb_test "jump $non_call_line" "Breakpoint ${decimal}, .*${srcfile}:$non_call_line.*" \
"jump to non-call"
# Set a breakpoint on the statement that we're about to jump to.
@@ -57,7 +57,7 @@
set bp_on_call 0
set call_line [gdb_get_line_number "bp-on-call"]
gdb_test_multiple "break $call_line" "break before jump to call" {
- -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line $call_line.*$gdb_prompt $" {
+ -re "\[Bb\]reakpoint (${decimal}) at ${hex}: file .*${srcfile}, line $call_line.*$gdb_prompt $" {
set bp_on_call $expect_out(1,string)
pass "break before jump to call"
}
@@ -66,7 +66,7 @@
# Can we jump to the statement? Do we stop there?
#
gdb_test "jump $call_line" \
- "Breakpoint \[0-9\]*, .*${srcfile}:$call_line.*" \
+ "Breakpoint ${decimal}, .*${srcfile}:$call_line.*" \
"jump to call"
# If we disable the breakpoint at the function call, and then
@@ -75,7 +75,7 @@
#
gdb_test_no_output "disable $bp_on_call" "disable breakpoint on call"
-gdb_test "jump $call_line" "Breakpoint \[0-9\]*, .*${srcfile}:$non_call_line.*" \
+gdb_test "jump $call_line" "Breakpoint ${decimal}, .*${srcfile}:$non_call_line.*" \
"jump to call with disabled breakpoint"
# Verify that GDB responds gracefully to the "jump" command without
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -111,7 +111,7 @@
"breakpoint function shr2"
gdb_test "continue" \
- "Continuing\\..*Breakpoint \[0-9\]+, shr2 \\(.*\\) at.*shr2\\.c:.*shr2-return \\*\\/" \
+ "Continuing\\..*Breakpoint ${decimal}, shr2 \\(.*\\) at.*shr2\\.c:${decimal}.*shr2-return \\*\\/" \
"run until breakpoint set at a function"
--- a/gdb/testsuite/gdb.base/so-impl-ld.exp
+++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
@@ -61,12 +61,12 @@
# Verify that we can step into the second shlib call.
#
-gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \
+gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:${decimal}.* HERE .*" \
"step into solib call"
# Verify that we can step within the shlib call.
#
-gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call"
+gdb_test "next" "${decimal}\[ \t\]*\}.* STEP .*" "step in solib call"
# Verify that we can step out of the shlib call, and back out into
# the caller.
next prev parent reply other threads:[~2014-10-29 18:26 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 [this message]
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 03/16] Eliminate literal line numbers in call-ar-st.exp Andreas Arnez
2014-11-13 13:33 ` 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: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 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:02 ` [PATCH 09/16] Eliminate literal line numbers in mi-console.exp Andreas Arnez
2014-10-29 16:02 ` [PATCH 07/16] Eliminate literal line numbers in jump.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 11/16] Drop non-prototype C function header variants: solib1.c 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 10/16] 'callfuncs' test case: Fix typo in prototyped version Andreas Arnez
2014-10-29 16:04 ` [PATCH 15/16] GDB testsuite: drop non-prototype C function header variants 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 14/16] Drop non-prototype C function header variants: 'sepdebug' test case Andreas Arnez
2014-10-29 16:04 ` [PATCH 13/16] Drop non-prototype C function header variants: 'list' " Andreas Arnez
2014-11-12 12:33 ` Pedro Alves
2014-11-12 15:05 ` Andreas Arnez
2014-11-12 15:18 ` Pedro Alves
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=87h9ymag24.fsf@br87z6lw.de.ibm.com \
--to=arnez@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).