From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6CC8F3858CDB; Tue, 19 Mar 2024 09:04:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CC8F3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710839093; bh=vLYXp7UJ8akzBi+dZ9oi3qHlr3gxVBgiUh1dcbihtNY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ytEK5kTvOCFrqbs/VH53L8FFQHfh88e00Odw17rhlUDnOeRVazqRu3iK6FFqMU18g l/SH6lck2YS/39Nc5wxgFzZX5dTQttT1JvUFyAPqCwDDY5oq8Bspt/jyqzXzTEfgjX sOnrdkVEhuyNDD4QrQONkfm5YMAo0XPKBFME9KCk= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/31486] [gdb/tdep, aarch64] Hang when hitting access watchpoint on M1 Date: Tue, 19 Mar 2024 09:04:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: HEAD 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=3D31486 --- Comment #1 from Tom de Vries --- There's a similar issue with lldb (version 17.0.6), with less serious failu= re mode though. When setting a write watchpoint on data.u.size8twice[1], execution stops for reason "trace": ... $ lldb outputs/gdb.base/watchpoint-unaligned/watchpoint-unaligned (lldb) target create "outputs/gdb.base/watchpoint-unaligned/watchpoint-unaligned" Current executable set to '/home/vries/gdb/outputs/gdb.base/watchpoint-unaligned/watchpoint-unaligned' (aarch64). (lldb) b main Breakpoint 1: where =3D watchpoint-unaligned`main + 8 at watchpoint-unaligned.c:65:3, address =3D 0x0000000000410208 (lldb) r Process 1075081 launched: '/home/vries/gdb/outputs/gdb.base/watchpoint-unaligned/watchpoint-unaligned' (aarch64) Process 1075081 stopped * thread #1, name =3D 'watchpoint-unal', stop reason =3D breakpoint 1.1 frame #0: 0x0000000000410208 watchpoint-unaligned`main at watchpoint-unaligned.c:65:3 62=20=20 63 assert (sizeof (data) =3D=3D 8 + 3 * 8); 64=20=20 -> 65 write_size8twice (); 66=20=20 67 while (size) 68 { (lldb) watch set var -w write data.u.size8twice[1] Watchpoint created: Watchpoint 1: addr =3D 0x00440048 size =3D 8 state =3D = enabled type =3D w declare @ '/home/vries/gdb/src/gdb/testsuite/gdb.base/watchpoint-unaligned.c:35:3' watchpoint spec =3D 'data.u.size8twice[1]' new value: 0 (lldb) c Process 1075081 resuming Process 1075081 stopped * thread #1, name =3D 'watchpoint-unal', stop reason =3D trace frame #0: 0x00000000004101f0 watchpoint-unaligned`write_size8twice at watchpoint-unaligned.c:48:3 45=20=20 46 #ifdef __aarch64__ 47 volatile void *p =3D &data.u.size8twice[offset]; -> 48 asm volatile ("stp %1, %2, [%0]" 49 : /* output */ 50 : "r" (p), "r" (first), "r" (second) /* input */ 51 : "memory" /* clobber */); ... In contrast, when setting a write watchpoint on data.u.size8twice[0], execu= tion stops for reason "watchpoint": ... (lldb) c Process 1075169 resuming Watchpoint 1 hit: old value: 0 new value: 1 Process 1075169 stopped * thread #1, name =3D 'watchpoint-unal', stop reason =3D watchpoint 1 frame #0: 0x00000000004101f4 watchpoint-unaligned`write_size8twice at watchpoint-unaligned.c:56:1 53 data.u.size8twice[offset] =3D first; 54 data.u.size8twice[offset + 1] =3D second; 55 #endif -> 56 } 57=20=20 58 int 59 main (void) (lldb)=20 ... This is using a write watchpoint, but it's the same for a regular watchpoin= t.=20 Note that gdb handles a regualar watchpoint by reporting a watchpoint stop = in both (data.u.size8twice[0] and data.u.size8twice[1]) cases. --=20 You are receiving this mail because: You are on the CC list for the bug.=