[PATCH] gdb/reverse: Fix continue_to_breakpoint in syscall testcases.

Marcin Kościelnicki
2015-11-02T18:53:44Z

continue_to_breakpoint always continues to the next breakpoint, not to the
one named in parameter. This rendered the tests effectively useless, since
marker2 was never reached.

gdb/testsuite/ChangeLog:

* gdb.reverse/fstatat-reverse.exp: Fix continue_to_breakpoint.
* gdb.reverse/getresuid-reverse.exp: Fix continue_to_breakpoint.
* gdb.reverse/pipe-reverse.exp: Fix continue_to_breakpoint.
* gdb.reverse/readv-reverse.exp: Fix continue_to_breakpoint and comment.
* gdb.reverse/recvmsg-reverse.exp: Fix continue_to_breakpoint.
* gdb.reverse/time-reverse.exp: Fix continue_to_breakpoint.
* gdb.reverse/waitpid-reverse.exp: Fix continue_to_breakpoint, add KFAILs.
---
Here comes the fix.

gdb/testsuite/ChangeLog | 10 ++++++++++
gdb/testsuite/gdb.reverse/fstatat-reverse.exp | 2 ++
gdb/testsuite/gdb.reverse/getresuid-reverse.exp | 2 ++
gdb/testsuite/gdb.reverse/pipe-reverse.exp | 2 ++
gdb/testsuite/gdb.reverse/readv-reverse.exp | 4 +++-
gdb/testsuite/gdb.reverse/recvmsg-reverse.exp | 2 ++
gdb/testsuite/gdb.reverse/time-reverse.exp | 2 ++
gdb/testsuite/gdb.reverse/waitpid-reverse.exp | 4 ++++
8 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e01ee86..4ba75dc 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2015-11-02 Marcin KoÅ›cielnicki <koriakin@0x04.net>
+
+ * gdb.reverse/fstatat-reverse.exp: Fix continue_to_breakpoint.
+ * gdb.reverse/getresuid-reverse.exp: Fix continue_to_breakpoint.
+ * gdb.reverse/pipe-reverse.exp: Fix continue_to_breakpoint.
+ * gdb.reverse/readv-reverse.exp: Fix continue_to_breakpoint and comment.
+ * gdb.reverse/recvmsg-reverse.exp: Fix continue_to_breakpoint.
+ * gdb.reverse/time-reverse.exp: Fix continue_to_breakpoint.
+ * gdb.reverse/waitpid-reverse.exp: Fix continue_to_breakpoint, add KFAILs.
+
2015-10-30 Yao Qi <yao.qi@linaro.org>

* gdb.threads/wp-replication.c (watch_count_done): Remove.
diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
index 09deb6c..39401dc 100644
--- a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"

+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"

gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
index b93fb91..787457c 100644
--- a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"

+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"

gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/pipe-reverse.exp b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
index 482893a..d298a35 100644
--- a/gdb/testsuite/gdb.reverse/pipe-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"

+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"

gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.exp b/gdb/testsuite/gdb.reverse/readv-reverse.exp
index 4158c10..a98ded5 100644
--- a/gdb/testsuite/gdb.reverse/readv-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.exp
@@ -16,7 +16,7 @@
# This file is part of the gdb testsuite.

#
-# This test tests pipe syscall for reverse execution.
+# This test tests readv syscall for reverse execution.
#

if ![supports_reverse] {
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"

+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"

gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
index 7293a3d..1cb44d3 100644
--- a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"

+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"

gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp
index 9cec3c3..5b3d9a3 100644
--- a/gdb/testsuite/gdb.reverse/time-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/time-reverse.exp
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"

+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"

gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
index f4a4403..27d84a1 100644
--- a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
@@ -44,8 +44,12 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"

+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
+setup_kfail "gdb/19187" *-*-*
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"

+setup_kfail "gdb/19187" *-*-*
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"

# If the variable was recorded properly on syscall, the old contents (-1)
--
2.6.2