Skip to content
Snippets Groups Projects
Commit 93082b3d authored by Martin Storsjö's avatar Martin Storsjö Committed by Alexandre Julliard
Browse files

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: default avatarMartin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard's avatarAlexandre Julliard <julliard@winehq.org>
parent 2fb948e0
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment