From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA10D3851C33; Wed, 2 Dec 2020 13:27:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA10D3851C33 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/26991] FAIL: gdb.arch/i386-mpx-call.exp: upper_bnd0: continue to a bnd violation Date: Wed, 02 Dec 2020 13:27:49 +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: 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, 02 Dec 2020 13:27:49 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26991 --- Comment #2 from Tom de Vries --- As for the remaining failure. Things are made complicated by the fact that bnd0.lbound and bnd0.ubound are represented as 32-bit in -m32, while in the hardware they're actually 64-bi= t. This is reflected in the types: ... (gdb) ptype $bnd0 type =3D struct builtin_type_bound128 { void *lbound; void *ubound; } (gdb) ptype $bnd0raw type =3D struct br128 { uint64_t lbound; uint64_t ubound_raw; } ... So, the interesting thing is always to print the raw value to see what's actually written in the hw register. So, before the FAIL we have: ... (gdb) p /x $bnd0.lbound =3D $bnd0.ubound^M $19 =3D 0xffffffff^M (gdb) p /x $bnd0.ubound =3D 0^M $20 =3D 0x0^M (gdb) p /x $bnd0raw^M $21 =3D {lbound =3D 0xffffffff, ubound_raw =3D 0xffffffffffffffff}^M ... Now comparing that with the info found here ( https://www.felixcloutier.com/x86/bndmk ): ... BND.LB =E2=86=90 SRCMEM.base; IF 64-bit mode Then BND.UB =E2=86=90 NOT(LEA.64_bits(SRCMEM)); ELSE BND.UB =E2=86=90 Zero_Extend.64_bits(NOT(LEA.32_bits(SRCMEM))); FI; ... we can see that the value written into ubound_raw is not congruent with how bndmk would write it. Using this tentative patch: ... diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 00de4e1ccb..2ea28c68bd 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -3527,6 +3527,8 @@ i386_pseudo_register_write=20 raw_buf); upper =3D ~upper; + if (size =3D=3D 4) + upper =3D upper & 0xffffffff; /* Set register bits. */ memcpy (raw_buf, &lower, 8); ... fixes that, but not the FAIL. --=20 You are receiving this mail because: You are on the CC list for the bug.=