public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb.threads/process-dies-while-detaching: disable with software watchpoint
@ 2021-09-21 20:24 Lancelot SIX
       [not found] ` <36b3309b-ed0a-5248-d47b-351e480345fc@suse.de>
  0 siblings, 1 reply; 8+ messages in thread
From: Lancelot SIX @ 2021-09-21 20:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running gdb.threads/process-dies-while-detaching.exp on
riscv64-linux-gnu, I ran on a test which is not suited to be executed on
platforms that do not support hardware watchpoints.

The first clue is this first error:

    (gdb) watch globalvar
    Watchpoint 2: globalvar
    (gdb) FAIL: gdb.threads/process-dies-while-detaching.exp: single-process: detach: watchpoint: watch globalvar

With the associated test being:

    gdb_test "watch globalvar" ".* watchpoint $decimal: globalvar"

This regular expression only accepts hardware watchpoints which would
have printed something like "Hardware watchpoint  2: globalvar".  This
could easily be fixed, but there is more to come.  The next section of
the test continues until the _exit function.  Looking at the log, we can
see this times out.

    (gdb) continue
    Continuing.
    [New Thread 0x3ff7ea5150 (LWP 2529916)]
    [New Thread 0x3ff76a4150 (LWP 2529917)]
    [New Thread 0x3ff6ea3150 (LWP 2529918)]
    FAIL: gdb.threads/process-dies-while-detaching.exp: single-process: detach: watchpoint: continue to breakpoint: _exit (timeout)
    detach
    [New Thread 0x3ff66a2150 (LWP 2529919)]
    [New Thread 0x3ff5ea1150 (LWP 2529920)]
    [New Thread 0x3ff56a0150 (LWP 2529921)]
    [New Thread 0x3ff4e9f150 (LWP 2529922)]
    ...

Out of curiosity I launched manually the test, and this 'continue' using
software watchpoint is orders of magnitude longer to run than the entire
GDB testsuite (to be honest, I did not even let it finish).

With those two elements, I looks like that even if this test could be
executed on platform without hardware watchpoint, it is not advisable to
do so.

In this commit I propose to disable the parts of the tests that
are problematic when hardware support is not available.

Tested on risc64-linux-gnu
---
 gdb/testsuite/gdb.threads/process-dies-while-detaching.exp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
index ac1aad26ec5..0130db9668d 100644
--- a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
+++ b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
@@ -236,6 +236,12 @@ proc test_detach {multi_process cmd} {
 # Same as test_detach, except set a watchpoint before detaching.
 
 proc test_detach_watch {multi_process cmd} {
+    if {[skip_hw_watchpoint_tests]} {
+	# Using software watchpoint is way to slow to be included in the test.
+	# Trying to continue in this proc would result in a lot of FAILS due to
+	# timeouts.
+	return
+    }
     with_test_prefix "watchpoint" {
 	global binfile decimal
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-27 22:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-21 20:24 [PATCH] gdb.threads/process-dies-while-detaching: disable with software watchpoint Lancelot SIX
     [not found] ` <36b3309b-ed0a-5248-d47b-351e480345fc@suse.de>
2021-09-22 13:15   ` Tom de Vries
2021-09-22 21:40     ` Lancelot SIX
2021-09-26  9:54       ` Tom de Vries
2021-09-26 17:11         ` Lancelot SIX
2021-09-26 22:43           ` Tom de Vries
2021-09-27  8:21             ` Tom de Vries
2021-09-27 22:54               ` Lancelot SIX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).