From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8CD14385841D; Sun, 7 Jan 2024 13:42:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CD14385841D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704634971; bh=duPvCbVP7jPpz34edbs46UKEgDY/0ivUfxaZgC5MYAs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BN16loJgRUCe5GkORgCqA3Or2fFXgC6trADkVD6UzmjVv5VdPh0kkJ9ymFh+YTNzo E7shkuW/LKBIULVIiKhal50H8sybycmRC77LV2Cq+roaPDEFJeTCYtdg7IeR/qKEQF JXk1Vcxya17Yqql9eWu9FakdFQYpN94YLszsncW8= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/31214] [gdb, aarch64] FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.e: 0->5: continue Date: Sun, 07 Jan 2024 13:42:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 15.1 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=3D31214 --- Comment #2 from Tom de Vries --- (In reply to Tom de Vries from comment #1) > Put differently, aarch64_stopped_data_address should report back 0x440028 > and 0x440029 in both cases, and the caller should figure out which of the > two is actually triggered. Alternatively, it could report back a range > [0x440028-0x44002a]. This tentative patch addresses it slightly differently. It reports back no address: ... diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 5b4e3c2bde1..624884cd375 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -972,9 +972,7 @@ aarch64_linux_nat_target::stopped_data_address (CORE_AD= DR *addr_p) bool aarch64_linux_nat_target::stopped_by_watchpoint () { - CORE_ADDR addr; - - return stopped_data_address (&addr); + return stopped_data_address (nullptr); } /* Implement the "can_do_single_step" target_ops method. */ diff --git a/gdb/aarch64-nat.c b/gdb/aarch64-nat.c index ee8c5a1e21d..2cc0a0b707c 100644 --- a/gdb/aarch64-nat.c +++ b/gdb/aarch64-nat.c @@ -232,6 +232,7 @@ aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, CORE_ADDR addr_trap, CORE_ADDR *addr_p) { int i; + bool found =3D false; for (i =3D aarch64_num_wp_regs - 1; i >=3D 0; --i) { @@ -265,12 +266,19 @@ aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, range. ADDR_WATCH <=3D ADDR_TRAP < ADDR_ORIG is a false positive on kernels older than 4.10. See PR external/20207. */ - *addr_p =3D addr_orig; - return true; + + if (addr_p !=3D nullptr) + if (found && *addr_p !=3D addr_orig) + return false; + + found =3D true; + + if (addr_p !=3D nullptr) + *addr_p =3D addr_orig; } } - return false; + return found; } /* Define AArch64 maintenance commands. */ ... So, if called from stopped_by_watchpoint (addr_p =3D=3D nullptr), if there = is any hit, it returns true. Otherwise (addr_p !=3D nullptr) if there are multiple hits with conflicting addresses, it return false. Fixes the test-case. --=20 You are receiving this mail because: You are on the CC list for the bug.=