This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] btrace, test: avoid gdb.btrace/vdso.exp fail


The vdso.exp test checks that we can access the VDSO memory when replaying.

Depending on the line information generated by the compiler, runto_main may run
to the line marked with bp.1 or stop before that line.  The test incorrectly
assumes that it will always run to the marked line and fails if it doesn't.

The test does not really care about what is traced.  It does care that GDB is
replaying when capturing the second disassemble output.

Reflect that in the test by ignoring the output of the stepping and record goto
begin commands and by checking that GDB is actually replaying.

2015-10-01  Markus Metzger  <markus.t.metzger@intel.com>

testsuite/
	* gdb.btrace/vdso.c (main): Remove breakpoint markers.
	* gdb.btrace/vdso.exp: Change stepping command to "next" and ignore
	its output.  Ignore the output of "record goto begin" and instead
	check that GDB is replaying.
---
 gdb/testsuite/gdb.btrace/vdso.c   | 4 ++--
 gdb/testsuite/gdb.btrace/vdso.exp | 7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.btrace/vdso.c b/gdb/testsuite/gdb.btrace/vdso.c
index 3c236ba..3c51c89 100644
--- a/gdb/testsuite/gdb.btrace/vdso.c
+++ b/gdb/testsuite/gdb.btrace/vdso.c
@@ -24,7 +24,7 @@ main (void)
 {
   struct timeval tv;
 
-  gettimeofday (&tv, 0); /* main.1.  */
+  gettimeofday (&tv, 0);
 
-  return 0; /* main.2.  */
+  return 0;
 }
diff --git a/gdb/testsuite/gdb.btrace/vdso.exp b/gdb/testsuite/gdb.btrace/vdso.exp
index e0e62de..353c80f 100644
--- a/gdb/testsuite/gdb.btrace/vdso.exp
+++ b/gdb/testsuite/gdb.btrace/vdso.exp
@@ -37,11 +37,14 @@ set live_gettimeofday [capture_command_output "disassemble gettimeofday" ""]
 
 # trace the test code
 gdb_test_no_output "record btrace"
-gdb_test "next" "main\.2.*"
+gdb_test "stepi" ".*"
 
 with_test_prefix "replay" {
+	# start replaying
+	gdb_test "record goto begin" ".*"
+	gdb_test "info record" "Replay in progress\.\[^\\\r\\\n\]*"
+
 	# capture the disassembly of gettimeofday while replaying
-	gdb_test "record goto begin" "main\.1.*"
 	set replay_gettimeofday [capture_command_output "disassemble gettimeofday" ""]
 
 	# the two disassemblies must be identical
-- 
1.8.3.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]