From nobody Sat Nov 25 03:42:00 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Scd2K1n6Cz52RVj for ; Sat, 25 Nov 2023 03:42:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Scd2K0KZtz3YQP for ; Sat, 25 Nov 2023 03:42:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700883721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PWbcF0/mimmN6iwz8KcqpHVQcsUKSbUYOtn0iKqAJBo=; b=iHkM+0KMzpPCbxiO7AY+udIi2e/Kqmy+dfOSn0tYI6wSLn7nikMfTgsd3/yaJVc1CKNx8/ FQsRdAXjx86GyvYO4fb6jwAqVaeVQEoRymGJWoi7t5nNy5mJP3jfxSICfu+p9dt5sUAuPA an0uA4xvWWrMk4JFAKgX1/rNdR17oTrCx+g0SOA2TchIq3yCKImhx6W6gR2vCuzdaO7Psc cAf4drHHB4vJJ1y0d5UKVFf5fW4n4hkl3vunnIW6ZjIZaVuA09yHPaFFLb04Cq0QkOy24Y +SV1gz/CVtejwFhflgSg206wxUQyGvKl1dz7FKi+LgEXMzj24mHPyepIIgVKzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700883721; a=rsa-sha256; cv=none; b=ZoRyOD/2Kki+J/Jdb6N95TK0q8uV6J0w4UWIhgBWQV1VwoM5nf0I3xB7zcmlih3hAfdCwx PXEXXl6lazJIhGG/aVcWOE9M+IowA6fOv9yYsFjpS+483CBYX61PS53VpSFvnivQdkvLCG Ua7drHItoAezfOb9jLct2h/o0/h1QBYmUIVqpMVSBP66RfYp3TrkU8LRiVRPONVmgl/C42 PakvBPdBnug/YukkWh9JX/RB8fViQw91ScOS7AQVNctAapGSJBk1e6XcKi5bp9iw1JKx2p o5O7jlkubuY5SifLOB1z/O7zI97wW/v0oxtS3h/sjw2VDPKn3D7PDZXsVPTiQQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Scd2J6Xcyz1Bk2 for ; Sat, 25 Nov 2023 03:42:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 3AP3g0tQ069671 for ; Sat, 25 Nov 2023 03:42:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3AP3g0XX069670 for bugs@FreeBSD.org; Sat, 25 Nov 2023 03:42:00 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 275322] Improper handling of mxcsr register during debug (gdb/lldb) Date: Sat, 25 Nov 2023 03:42:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: cheyenne.wills@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.mimetype attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275322 Bug ID: 275322 Summary: Improper handling of mxcsr register during debug (gdb/lldb) Product: Base System Version: 14.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: cheyenne.wills@gmail.com Attachment #246554 text/plain mime type: Created attachment 246554 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D246554&action= =3Dedit C code to demonstrate the problem There is improper handling of the mxcsr register when debugging. It appears that the current mxcsr register is not being given to the debugger. The attached program illustrates the problem. compile the attached program:lang -mfpmath=3Dsse -mlong-double-64 -g -lm -o= {x} {x.c} Run the following debug session: gdb ./{x} break main run ** program should run to end with the following output: ra=3D7.01209994486364354e-310 reatt=3D10000000000 ra * reatt-> result =3D0 = savemxcsr 00001f80 mxcsr_set 00009fc0 showmxcsr 00009fc0 mxcsr 00001f80 disassemble main ** set a break at the mulsd instruction (should be around offset +81) run ** should now be at the mulsd instruction continue ** output should be the same as above run ** should now be at the mulsd instruction info register mxcsr ** output should be: mxcsr 0x1f80 [ IM DM ZM OM UM PM ] ** which is incorrect since it there was a ldmxcsr instruction around offset +39 and the result should be: mxcsr 0x9fc0 [ DAZ IM DM ZM OM UM PM FZ ] continue ** output shows incorrect output: ra=3D7.01209994486364354e-310 reatt=3D10000000000 ra * reatt-> result =3D7.01209994486364403e-300 savemxcsr 00001f80 mxcsr_set 00009fc0 showmxcsr 00009fc0 mxcsr 00001fa2 ** since it appears that the mxcsr register is being reset back to the 0x1f= 80 value after it was displayed --=20 You are receiving this mail because: You are the assignee for the bug.=