PING [PATCH RFC] PR gdb/17445 fix
Pierre Muller
pierre.muller@ics-cnrs.unistra.fr
Thu Nov 6 09:13:00 GMT 2014
Nobody reacted yet to my first email.
This email is about a fix to:
https://sourceware.org/bugzilla/show_bug.cgi?id=17445
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.
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 : binutils-owner@sourceware.org [mailto:binutils-
> owner@sourceware.org] De la part de Pierre Muller
> Envoyé : mercredi 1 octobre 2014 09:46
> À : binutils@sourceware.org; gdb-patches@sourceware.org
> Objet : [RFC] PR gdb/17445 fix
>
> 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.
>
> Comments most welcome,
>
> Pierre Muller
> Pascal language maintainer for GDB.
>
> 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.
>
>
> ChangeLog (needs to be split into binutils/gas/gdb directories)
>
> 2014-10-01 Pierre Muller <muller@sourceware.org>
>
> 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.
>
> * 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.
>
> * gdb/dwarf2-frame.c (dwarf2_frame_cache): Avoid double
> handling of
> return address column.
More information about the Binutils
mailing list