From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 688BC3857371; Wed, 8 Jun 2022 09:48:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 688BC3857371 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/29196] [gdb, gcc-12/m32/pie] FAIL: gdb.base/gdb11531.exp: watchpoint variable triggers at next Date: Wed, 08 Jun 2022 09:48:45 +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: 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2022 09:48:45 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29196 --- Comment #6 from Tom de Vries --- I played around a bit with the test-case and created break2.c: ... struct some_struct { int a_field; int b_field; union { int z_field; }; }; struct some_struct values[50]; void marker4 (long d) { int volatile i =3D 1; values[0].a_field =3D d; } ... which I compiled with gcc-12: ... $ gcc-12 -B ./build/gcc break2.c -c -O2 -g -m32 -pie -fPIE ... and found: ... 00000000 : 0: e8 fc ff ff ff call 1 5: 05 01 00 00 00 add $0x1,%eax a: 83 ec 10 sub $0x10,%esp d: 8b 54 24 14 mov 0x14(%esp),%edx 11: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 18: 00=20 19: 89 90 00 00 00 00 mov %edx,0x0(%eax) 1f: 83 c4 10 add $0x10,%esp 22: c3 ret=20=20=20=20 ... So, in this case the get_pc_thunk call ends up _before_ the usual prologue part, which is something the current code doesn't take into account: ... @@ -1821,7 +1934,9 @@ i386_analyze_prologue (struct gdbarch *gdbarch, pc =3D i386_skip_probe (pc); pc =3D i386_analyze_stack_align (pc, current_pc, cache); pc =3D i386_analyze_frame_setup (gdbarch, pc, current_pc, cache); - return i386_analyze_register_saves (pc, current_pc, cache); + pc =3D i386_analyze_register_saves (pc, current_pc, cache); + pc =3D i386_skip_call_pc_thunk (gdbarch, pc, cache); + return pc; } /* Return PC of first real instruction. */ ... --=20 You are receiving this mail because: You are on the CC list for the bug.=