From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 52ED53858C62; Sat, 16 Mar 2024 11:54:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52ED53858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710590056; bh=BOmq1fp+Fey09raUdH/d1a/BBNwc9FYonZXn5Kwn7AQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=a0LocQGSaVQpwJ8dWhZ5hwyuPtWPOLA/GBgHN08brTKGIW92kqblmCY5KtPMZZZ6w rG8lgm1PvH+72kvJ/uCUKEgTbo1yPFU2KLepTliGoT04QXUK25l95kXuZ1qnPq3/OL COcLr8XtQaAuCza6903XgLp+5jCofUqBJgLOAc58= From: "boudewijn83 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/31481] Certain instructions load the wrong RIP-relative memory after setting a breakpoint Date: Sat, 16 Mar 2024 11:54:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: boudewijn83 at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: attachments.created 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=3D31481 --- Comment #4 from Boudewijn --- Created attachment 15409 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D15409&action=3Ded= it Proposed patch, fixes #28999 and #31481 There's actually no need for an extra lookup table. All (E)VEX prefixed instructions share the same two properties: - the (explicit part of the) opcode is only 1 byte - they all have a ModRM byte, except VZEROALL/VZEROUPPER So when there's an (E)VEX prefix it suffices to test for VZEROALL/VZEROUPPER (opcode 0x77): if (vex2 or vex3 or evex) { details->opcode_len =3D 1; need_modrm =3D (*insn !=3D 0x77); } else { use the legacy has_modrm tables } I've attached a patch that implements this. PS: I've tested VEX2/VEX3, but don't have an AVX-512 capable CPU so I'm not able to test the EVEX handling. --=20 You are receiving this mail because: You are on the CC list for the bug.=