From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1E53C3839A35; Tue, 4 Jun 2024 12:06:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E53C3839A35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1717502765; bh=38dGos3KZM8OvMDnxWZKE333toIr+cxAosBl1KqTzNQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VIXMqXatyhndgdBju4Z6/BVkgSvTNH8zyKfnTRVfzeB5ShcmjB0+jV+fflQFhKLyp VIPJKRcGHYl0ltvdpZXTx0ogFOemk7ly5F1q6e9UmcR1BoVqzlstPFpP1bK9r8df6b v70DRmGpt7b3rhsUPg/SaoHSR6+SiNzeAkRyxXmg= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/31705] gdb.base/watchpoint-running.exp fails on arm Date: Tue, 04 Jun 2024 12:06:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31705 --- Comment #16 from Tom de Vries --- (In reply to Pedro Alves from comment #15) > Much better, thanks! Alternatively, this approach works for both arm and ppc (see PR31834): ... diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index c95d420d416..d8b5a99269b 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -454,6 +454,18 @@ linux_init_ptrace_procfs (pid_t pid, int attached) linux_ptrace_init_warnings (); linux_proc_init_warnings (); proc_mem_file_is_writable (); + + /* Some targets (for instance ppc and arm) may call ptrace to answer a + target_can_use_hardware_watchpoint query, and cache the result. Howe= ver, + the ptrace call will fail with errno ESRCH if the tracee is not + ptrace-stopped, making the query fail. And if the caching mechanism = does + not disregard an ESRCH result, all subsequent queries will also fail. + Call it now, where we known the tracee is ptrace-stopped. + + Other targets (for instance aarch64) do the relevant ptrace call and + caching in their implementation of post_attach and post_startup_infer= ior, + in which case this call is expected to have no effect. */ + target_can_use_hardware_watchpoint (bp_hardware_watchpoint, 1, 0); } linux_nat_target::~linux_nat_target () ... --=20 You are receiving this mail because: You are on the CC list for the bug.=