ntdll: Fix arm64 unwind across ELF/PE boundaries.
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: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Showing
Please
register
or
sign in
to comment