ntdll: Trust libunwind's returned pc value on arm64.

Use this instead of manually copying LR to PC. With GNU libunwind,
both registers are equal after unw_step.

With the LLVM libunwind (which Apple uses), the return address isn't
reflected at all in LR, only in UNW_REG_IP.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Martin Storsjo 2020-08-14 14:54:15 +03:00 committed by Alexandre Julliard
parent 849d08b0ae
commit cffd06ea67
1 changed files with 1 additions and 1 deletions

View File

@ -230,7 +230,7 @@ NTSTATUS CDECL unwind_builtin_dll( ULONG type, DISPATCHER_CONTEXT *dispatch, CON
unw_get_reg( &cursor, UNW_AARCH64_X29, (unw_word_t *)&context->u.s.Fp );
unw_get_reg( &cursor, UNW_AARCH64_X30, (unw_word_t *)&context->u.s.Lr );
unw_get_reg( &cursor, UNW_AARCH64_SP, (unw_word_t *)&context->Sp );
context->Pc = context->u.s.Lr;
unw_get_reg( &cursor, UNW_REG_IP, (unw_word_t *)&context->Pc );
context->ContextFlags |= CONTEXT_UNWOUND_TO_CALL;
TRACE( "next function pc=%016lx%s\n", context->Pc, rc ? "" : " (last frame)" );