From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 296A83858422; Mon, 28 Nov 2022 17:07:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 296A83858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669655236; bh=vG9ORsNZLRCxhKpzddayzlkPAFQLIpDtHZG+DZG5Pgo=; h=From:To:Subject:Date:From; b=jXx7xNsaLQ0QJlTmxHRkLrsNAVRPepXYiufR9uEv8gv9XSzzGe6IXM+V0+tYlxua5 dAD2AKSI4fxuKrFg0taQ+QVDomNZWexW72Wbe0J0MpGSiFadbcE+m+qclp2RyeOtgU AwTOiCg3BnCtTD1cMrtK7GbKokTpr8kSb5Tt2+5o= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Require hw watchpoint in gdb.ada/task_watch.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: b4bb9faa78c7454e9aafa4fbdbf76e4206acd14a X-Git-Newrev: 149700668dca44a0f8e1b0aab1711901935c5bd8 Message-Id: <20221128170716.296A83858422@sourceware.org> Date: Mon, 28 Nov 2022 17:07:16 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D149700668dca= 44a0f8e1b0aab1711901935c5bd8 commit 149700668dca44a0f8e1b0aab1711901935c5bd8 Author: Tom de Vries Date: Mon Nov 28 18:07:12 2022 +0100 [gdb/testsuite] Require hw watchpoint in gdb.ada/task_watch.exp =20 On powerpc64le-linux I run into: ... (gdb) PASS: gdb.ada/task_watch.exp: info tasks before inserting breakpo= int watch -location value task 3^M Watchpoint 2: -location value^M (gdb) PASS: gdb.ada/task_watch.exp: watch -location value task 3 continue^M Continuing.^M [Thread 0x7ffff7ccf170 (LWP 65550) exited]^M [Thread 0x7ffff7abf170 (LWP 65551) exited]^M FAIL: gdb.ada/task_watch.exp: continue to watchpoint (timeout) ... =20 On x86_64-linux (where the test-case passes), a hardware watchpoint is = used: ... (gdb) PASS: gdb.ada/task_watch.exp: info tasks before inserting breakpo= int watch -location value task 3^M Hardware watchpoint 2: -location value^M ... and after forcing "set can-use-hw-watchpoints 0" we can intermittently reproduce the same failure. =20 In the gdb documentation related to watchpoints in multi-threaded progr= ams, we read: ... Warning: In multi-threaded programs, software watchpoints have only lim= ited usefulness. If GDB creates a software watchpoint, it can only watch th= e value of an expression in a single thread. If you are confident that the exp= ression can only change due to the current thread=E2=80=99s activity (and if yo= u are also confident that no other thread can become current), then you can use so= ftware watchpoints as usual. However, GDB may not notice when a non-current t= hread=E2=80=99s activity changes the expression. (Hardware watchpoints, in contrast, w= atch an expression in all threads.) ... =20 Since the ada task construct is mapped onto threads, it seems that the same limitation holds for tasks. =20 Fix this by using skip_hw_watchpoint_tests. =20 Tested on powerpc64-linux. Tested-By: Carl Love Diff: --- gdb/testsuite/gdb.ada/task_watch.exp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gdb/testsuite/gdb.ada/task_watch.exp b/gdb/testsuite/gdb.ada/t= ask_watch.exp index b22a6204e90..697074ac164 100644 --- a/gdb/testsuite/gdb.ada/task_watch.exp +++ b/gdb/testsuite/gdb.ada/task_watch.exp @@ -19,6 +19,8 @@ load_lib "ada.exp" =20 if { [skip_ada_tests] } { return -1 } =20 +if { [skip_hw_watchpoint_tests] } { return -1 } + standard_ada_testfile foo =20 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] !=3D ""= } {