btrace, test: avoid gdb.btrace/vdso.exp fail
authorMarkus Metzger <markus.t.metzger@intel.com>
Wed, 30 Sep 2015 09:41:35 +0000 (11:41 +0200)
committerMarkus Metzger <markus.t.metzger@intel.com>
Fri, 9 Oct 2015 12:29:41 +0000 (14:29 +0200)
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.

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/ChangeLog
gdb/testsuite/gdb.btrace/vdso.c
gdb/testsuite/gdb.btrace/vdso.exp

index a48bbeefba9602e3ca86e67b8fc9b3e22fbc5517..71765a8c911a18b79b0a8dede1591c611a3c92b4 100644 (file)
@@ -1,3 +1,10 @@
+2015-10-09  Markus Metzger  <markus.t.metzger@intel.com>
+
+       * 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.
+
 2015-10-09  Pedro Alves  <palves@redhat.com>
 
        * gdb.base/a2-run.exp (maybe_exp_continue): New procedure.
index 3c236ba1d6ab7447c145cb2ccd80983cf24e7447..3c51c89700ad2df708b94bb5eaddaa232754ee48 100644 (file)
@@ -24,7 +24,7 @@ main (void)
 {
   struct timeval tv;
 
-  gettimeofday (&tv, 0); /* main.1.  */
+  gettimeofday (&tv, 0);
 
-  return 0; /* main.2.  */
+  return 0;
 }
index e0e62deaf0c9e8ab06bef4014fbf2a3b8bd5da80..353c80fda04bee8cbc27b0ee1f6cae2bfed402ff 100644 (file)
@@ -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