[v3 1/3] ntdll: Set Dr7 when saving context.

Sebastian Lackner sebastian at fds-team.de
Sun Feb 5 00:31:20 CST 2017


On 05.02.2017 07:10, Andrew Wesie wrote:
> This is a work-around so that Dr7 is initialized to a reasonable value. Before
> it was just uninitialized memory. The test will fail without the work-around,
> and shows a todo if Dr7 is zero.
> 
> Signed-off-by: Andrew Wesie <awesie at gmail.com>
> ---
>  dlls/ntdll/signal_x86_64.c   |   1 +
>  dlls/ntdll/tests/exception.c | 121 +++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 122 insertions(+)
> 
> diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
> index f33fe4c..af16cfd 100644
> --- a/dlls/ntdll/signal_x86_64.c
> +++ b/dlls/ntdll/signal_x86_64.c
> @@ -1692,6 +1692,7 @@ static void save_context( CONTEXT *context, const ucontext_t *sigcontext )
>          context->u.FltSave = *FPU_sig(sigcontext);
>          context->MxCsr = context->u.FltSave.MxCsr;
>      }
> +    context->Dr7 = 0;
>  }
>  
>  

Wouldn't it make more sense to add a proper implementation for all debug registers?
We already have the signal_i386 code for an example how to do it, and other functions
like NtGetContextThread also support querying the debug registers (even on x86_64).

Best regards,
Sebastian




More information about the wine-devel mailing list