From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2136 invoked by alias); 6 Nov 2014 09:13:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 2055 invoked by uid 89); 6 Nov 2014 09:13:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_40,MSGID_MULTIPLE_AT autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mailhost.u-strasbg.fr Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.222.215) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Nov 2014 09:13:28 +0000 Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antispam (Postfix) with ESMTP id 7D5E0A0B27; Thu, 6 Nov 2014 10:13:25 +0100 (CET) Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id 6D61BA0C01; Thu, 6 Nov 2014 10:13:25 +0100 (CET) Received: from lmr.u-strasbg.fr (lmr4.u-strasbg.fr [172.30.21.4]) by mr5.u-strasbg.fr (Postfix) with ESMTP id 394AAA0B27; Thu, 6 Nov 2014 10:13:22 +0100 (CET) Received: from lmr.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id 0A338E8; Thu, 6 Nov 2014 10:13:22 +0100 (CET) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (Authenticated sender: mullerp) by lmr4.u-strasbg.fr (Postfix) with ESMTPSA id 9ECC09A; Thu, 6 Nov 2014 10:13:18 +0100 (CET) From: "Pierre Muller" To: , Cc: "'Kai Tietz'" References: <005301cfdd4b$aefd3830$0cf7a890$@muller@ics-cnrs.unistra.fr> In-Reply-To: <005301cfdd4b$aefd3830$0cf7a890$@muller@ics-cnrs.unistra.fr> Subject: PING [PATCH RFC] PR gdb/17445 fix Date: Thu, 06 Nov 2014 09:13:00 -0000 Message-ID: <001b01cff9a1$e8e4bfb0$baae3f10$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-11/txt/msg00111.txt.bz2 Nobody reacted yet to my first email. This email is about a fix to: https://sourceware.org/bugzilla/show_bug.cgi?id=3D17445 The bug report is about a problem that arises if you use xmm15 a register variable in windows 64-bit code. The current GDB code overlaps xmm15 and pc saved addresses, which leads a wrong backtrace. =20=20 The problem relates to an older thread https://sourceware.org/ml/binutils/2011-01/msg00323.html and https://sourceware.org/ml/binutils/2013-12/msg00232.html which mainly involved Kai. Kai, did you see my previous email? Could you comment on my analysis of the problem. Pierre Muller > -----Message d'origine----- > De=A0: binutils-owner@sourceware.org [mailto:binutils- > owner@sourceware.org] De la part de Pierre Muller > Envoy=E9=A0: mercredi 1 octobre 2014 09:46 > =C0=A0: binutils@sourceware.org; gdb-patches@sourceware.org > Objet=A0: [RFC] PR gdb/17445 fix >=20 > Bug report gdb/17445 > shows that use of explicit xmm15 register in windows x86_64 > code leads to wrong unwinding of stacktrace by GDB. > This problem comes from the fact that > the return address column is set to 32 for x86_64 pe objects, > while it is 16 for other targets. > Dwarf x86_64 register 16 is RIP, > while register 32 is XMM15. > The reason for this was apparently that the value of > the return address column is also interpreted as the highest > index of the register that needs to be saved according to the ABI > which is indeed different for Microsoft. > Nevertheless, I found nothing inside DWARF4 documentation > that makes any relation between the resisters that should be saved > and the return address column. > I came to the conclusion that this is a mis-interpretation > of the dwarf standard that is specific to GNU bfd-gas-gdb. > The patch proposed below tries to fix the current PR > by removing the above assumptions and restoring RIP > as return address register for pe(i)-x86-64 targets. >=20 > Comments most welcome, >=20 > Pierre Muller > Pascal language maintainer for GDB. >=20 > PS: One problem is that I was not able to correctly run > the testsuite before and after my patch, as > there are still cygwin/mingw specific issues with testsuite runs. >=20 >=20 > ChangeLog (needs to be split into binutils/gas/gdb directories) >=20 > 2014-10-01 Pierre Muller >=20 > PR gdb/17445 > * binutils/dwarf.c (display_debug_frames): Handle return > address > column > specifically, do not limit num_regs to the value of return > address > column. > Modified handling of DW_CFA_restore{_extended} to check that > a valid storage is present at restore point. >=20 > * gas/config/tc-i386.c (x86_dwarf2_return_column): Remove > special > value for x86_64 pe coff return address column. > This restores RIP register for return address column. >=20 > * gdb/dwarf2-frame.c (dwarf2_frame_cache): Avoid double > handling of > return address column.