• Martin Storsjo's avatar
    ntdll: Fix arm64 unwind across ELF/PE boundaries. · 93082b3d
    Martin Storsjo authored
    The previous implementation might have given the impression of
    working, as long in some cases where the PE code actually used frame
    pointers, but turned out to be subly wrong.
    
    This essentially reverts the functional aspects of 1c9fdaab.
    
    Use the new value of the Lr register, after fetching the registers
    from unw_step, as the return value.
    
    To make single-stepping unwinding work properly, treat the registers
    consistently:
    
    - Make RtlCaptureContext store the current values of x29/Fp and x30/Lr
    from within the function, not the ones backed up from the stack.
    
    - After unwinding one step, first fetch the new values of all registers,
    including the new value of Lr - then use this value of Lr to set the
    new value of Pc (the address to actually return to).
    
    This makes the unwinding actually coherent in reading unwind opcodes and
    return addresses from one single function; previously these were out of
    sync where the return address ended up being read from the function
    one step further up in the call stack.
    
    This fixes unwinding for setjmp for binaries compiled with clang
    (in mingw mode).
    Signed-off-by: 's avatarMartin Storsjo <martin@martin.st>
    Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
    93082b3d
Name
Last commit
Last update
dlls Loading commit data...
documentation Loading commit data...
fonts Loading commit data...
include Loading commit data...
libs Loading commit data...
loader Loading commit data...
nls Loading commit data...
po Loading commit data...
programs Loading commit data...
server Loading commit data...
tools Loading commit data...
.editorconfig Loading commit data...
.mailmap Loading commit data...
ANNOUNCE Loading commit data...
AUTHORS Loading commit data...
COPYING.LIB Loading commit data...
LICENSE Loading commit data...
LICENSE.OLD Loading commit data...
MAINTAINERS Loading commit data...
Makefile.in Loading commit data...
README Loading commit data...
VERSION Loading commit data...
aclocal.m4 Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...