From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3DC423858D39; Mon, 13 Dec 2021 16:37:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3DC423858D39 From: "aburgess at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/28681] Wrong pretty-printed unique_ptr value when using "finish" Date: Mon, 13 Dec 2021 16:37:34 +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: aburgess at redhat dot com 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: cc 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: Mon, 13 Dec 2021 16:37:34 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28681 Andrew Burgess changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aburgess at redhat dot com --- Comment #1 from Andrew Burgess --- I see the same result on x86-64. I'm just guessing right now, but I suspect that this is a case of the result being miss-classified as something that c= an be passed in register, when, it is really something that is passed in memor= y. The sys-v ABI says that if the return value is a non-trivial, C++ object, t= he caller should allocate space for the return value, and pass the address of = the space to the callee as a hidden first argument. The address of the object should then be returned as the return value. Checking the disassembly of this test, and I can confirm that this is what = is happening. However, on return, GDB appears to treat the address of the unique_ptr on t= he stack as if that was the unique_ptr, so I suspect, that GDB has classified = the return value as being passed in register, rather than in memory. The culprit is likely to be amd64_return_value (or something called from th= at function) for x86-64. --=20 You are receiving this mail because: You are on the CC list for the bug.=