aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2021-03-06 01:49:27 +0100
committerMark Wielaard <mark@klomp.org>2021-03-06 02:51:04 +0100
commitb0a8c2ff9c1b5f7d2e1ef1e0d65dcff0e9f089cc (patch)
treee2ef9d2435d9927ba5b8143f12d45270c415a587 /gdb
parentdd99cf0c580ac7b989a991283fa9f3eab07aec99 (diff)
downloadgdb-b0a8c2ff9c1b5f7d2e1ef1e0d65dcff0e9f089cc.zip
gdb-b0a8c2ff9c1b5f7d2e1ef1e0d65dcff0e9f089cc.tar.gz
gdb-b0a8c2ff9c1b5f7d2e1ef1e0d65dcff0e9f089cc.tar.bz2
Make valgrind tests more robust by adding --wait=1 to vgdb invocation
On my setup some valgrind tests failed somewhat reliably because the target remote | vgdb command couldn't find the vgdb-pipe files because valgrind startup hadn't finished yet. I tried to fix this by replacing the "Memcheck, a memory error detector" match to "TO DEBUG THIS PROCESS USING GDB: start GDB like this" which is right before valgrind creates the vgdb-pipe files. But even that didn't guarantee that the vgdb-pipe files were there (maybe valgrind should print that text after it has created them?). But also not all tests use --vgdb-error=0, so the text isn't always printed. To make the tests reliable I added --wait=1 to the vgdb invocation. That tells vgdb to try to find the vgdb-pipe files, and if they aren't there yet, to wait 1 second and try again. gdb/testsuite/ChangeLog: * lib/valgrind.exp (vgdb_start): Add --wait=1 to vgdbcmd.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/lib/valgrind.exp2
2 files changed, 5 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 9e1d61f..b7c2e72 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2021-03-05 Mark Wielaard <mark@klomp.org>
+
+ * lib/valgrind.exp (vgdb_start): Add --wait=1 to vgdbcmd.
+
2021-03-06 Weimin Pan <weimin.pan@oracle.com>
* gdb.base/ctf-ptype.exp: Add function tests and fix typos.
diff --git a/gdb/testsuite/lib/valgrind.exp b/gdb/testsuite/lib/valgrind.exp
index c0b4dc7..c214491 100644
--- a/gdb/testsuite/lib/valgrind.exp
+++ b/gdb/testsuite/lib/valgrind.exp
@@ -87,7 +87,7 @@ proc vgdb_start { {active_at_startup 1} } {
# gdbserver and connect to it.
gdb_test "disconnect" ".*"
- set vgdbcmd "target remote | vgdb --pid=$vgdbpid"
+ set vgdbcmd "target remote | vgdb --wait=1 --pid=$vgdbpid"
if { $active_at_startup } {
gdb_test "$vgdbcmd" " in \\.?_start .*" "target remote for vgdb"
} else {