Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/ntdll/unix/signal_i386.c | 9 +++++++++ dlls/ntdll/unix/signal_x86_64.c | 9 +++++++++ 2 files changed, 18 insertions(+)
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 87024e1bfce..28e95c084db 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -2478,6 +2478,15 @@ PCONTEXT DECLSPEC_HIDDEN get_initial_context( LPTHREAD_START_ROUTINE entry, void wait_suspend( &context ); ctx = (CONTEXT *)((ULONG_PTR)context.Esp & ~15) - 1; *ctx = context; + if (context.ContextFlags & CONTEXT_DEBUG_REGISTERS & ~CONTEXT_i386) + { + x86_thread_data()->dr0 = context.Dr0; + x86_thread_data()->dr1 = context.Dr1; + x86_thread_data()->dr2 = context.Dr2; + x86_thread_data()->dr3 = context.Dr3; + x86_thread_data()->dr6 = context.Dr6; + x86_thread_data()->dr7 = context.Dr7; + } } else { diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index dcb0e588c66..2332befdf40 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2754,6 +2754,15 @@ PCONTEXT DECLSPEC_HIDDEN get_initial_context( LPTHREAD_START_ROUTINE entry, void wait_suspend( &context ); ctx = (CONTEXT *)((ULONG_PTR)context.Rsp & ~15) - 1; *ctx = context; + if (context.ContextFlags & CONTEXT_DEBUG_REGISTERS & ~CONTEXT_AMD64) + { + amd64_thread_data()->dr0 = context.Dr0; + amd64_thread_data()->dr1 = context.Dr1; + amd64_thread_data()->dr2 = context.Dr2; + amd64_thread_data()->dr3 = context.Dr3; + amd64_thread_data()->dr6 = context.Dr6; + amd64_thread_data()->dr7 = context.Dr7; + } } else {