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]

Make watchpoint-multi.exp 's output messages unique.


While debugging gdbserver yesterday, I noticed that not all test messages are unique:

      1 PASS: gdb.multi/watchpoint-multi.exp: add-inferior
      1 PASS: gdb.multi/watchpoint-multi.exp: awatch b
      1 PASS: gdb.multi/watchpoint-multi.exp: awatch c
      1 PASS: gdb.multi/watchpoint-multi.exp: catch b
      1 PASS: gdb.multi/watchpoint-multi.exp: catch c
      1 PASS: gdb.multi/watchpoint-multi.exp: catch marker_exit in inferior 1
      1 PASS: gdb.multi/watchpoint-multi.exp: catch marker_exit in inferior 2
      1 PASS: gdb.multi/watchpoint-multi.exp: set breakpoint always-inserted on
      1 PASS: gdb.multi/watchpoint-multi.exp: set displaced-stepping on
      1 PASS: gdb.multi/watchpoint-multi.exp: start to main inferior 1
      1 PASS: gdb.multi/watchpoint-multi.exp: start to main inferior 2
      1 PASS: gdb.multi/watchpoint-multi.exp: successfully compiled posix threads test case
      2 PASS: gdb.multi/watchpoint-multi.exp: inferior 1
      2 PASS: gdb.multi/watchpoint-multi.exp: inferior 2

I also had a bit of trouble following what should have happened by looking at
the test FAILs.

This fixes the uniqueness, and adds a bit more context to the messages.  I've applied it.

2012-01-26  Pedro Alves  <palves@redhat.com>

	Make test messages unique, and more identifiable.
	* gdb.multi/watchpoint-multi.exp: Change test messages.

---
 gdb/testsuite/gdb.multi/watchpoint-multi.exp |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.exp b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
index 3c4ad8b..bb5675b 100644
--- a/gdb/testsuite/gdb.multi/watchpoint-multi.exp
+++ b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
@@ -56,36 +56,42 @@ if [support_displaced_stepping] {
 gdb_breakpoint main {temporary}
 gdb_test "run" "Temporary breakpoint.* main .*" "start to main inferior 1"

-gdb_test "add-inferior" "Added inferior 2"
-gdb_test "inferior 2" "witching to inferior 2 .*"
+gdb_test "add-inferior" "Added inferior 2" "add inferior 2"
+gdb_test "inferior 2" "witching to inferior 2 .*" "switch to inferior 2, first time"
 gdb_load $binfile

 gdb_breakpoint main {temporary}
 gdb_test "run" "Temporary breakpoint.* main .*" "start to main inferior 2"

-gdb_test "awatch c" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c"
+gdb_test "awatch c" \
+    "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c" \
+    "awatch c on inferior 2"

 gdb_breakpoint "marker_exit"

-gdb_test "inferior 1" "witching to inferior 1 .*"
+gdb_test "inferior 1" "witching to inferior 1 .*" "switch back to inferior 1"

 if [skip_hw_watchpoint_multi_tests] {
     # On single hardware watchpoint at least test the watchpoint in inferior
     # 2 is not hit.
 } else {
-    gdb_test "awatch b" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b"
+    gdb_test "awatch b" \
+	"Hardware access \\(read/write\\) watchpoint \[0-9\]+: b" \
+	"awatch b on inferior 1"

-    gdb_test "inferior 2" "witching to inferior 2 .*"
+    gdb_test "inferior 2" "witching to inferior 2 .*" "switch to inferior 2 again"

     # FAIL would be a hit on watchpoint for `b' - that one is for the other
     # inferior.
-    gdb_test "continue" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c\r\n\r\nOld value = 0\r\nNew value = 3\r\n.*" "catch c"
+    gdb_test "continue" \
+	"Hardware access \\(read/write\\) watchpoint \[0-9\]+: c\r\n\r\nOld value = 0\r\nNew value = 3\r\n.*" \
+	"catch c on inferior 2"

     gdb_test "continue" "Breakpoint \[0-9\]+, marker_exit .*" "catch marker_exit in inferior 2"

-    gdb_test "inferior 1" "witching to inferior 1 .*"
+    gdb_test "inferior 1" "witching to inferior 1 .*" "switch back to inferior 1 again"

-    gdb_test "continue" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b\r\n\r\nOld value = 0\r\nNew value = 2\r\n.*" "catch b"
+    gdb_test "continue" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b\r\n\r\nOld value = 0\r\nNew value = 2\r\n.*" "catch b on inferior 1"
 }

 gdb_test "continue" "Breakpoint \[0-9\]+, marker_exit .*" "catch marker_exit in inferior 1"


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