mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 18:37:17 +00:00
server: Clear dr7 before setting other registers.
Resetting their length to make sure we pass alignment checks both for their current values and for the new values we'll write. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46472 Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3d5f8b9869
commit
4db8cdc267
|
@ -633,8 +633,7 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign
|
||||||
switch (context->machine)
|
switch (context->machine)
|
||||||
{
|
{
|
||||||
case IMAGE_FILE_MACHINE_I386:
|
case IMAGE_FILE_MACHINE_I386:
|
||||||
/* Linux 2.6.33+ does DR0-DR3 alignment validation, so it has to know LEN bits first */
|
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(7), 0 ) == -1) goto error;
|
||||||
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(7), context->debug.i386_regs.dr7 & 0xffff0000 ) == -1) goto error;
|
|
||||||
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(0), context->debug.i386_regs.dr0 ) == -1) goto error;
|
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(0), context->debug.i386_regs.dr0 ) == -1) goto error;
|
||||||
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(1), context->debug.i386_regs.dr1 ) == -1) goto error;
|
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(1), context->debug.i386_regs.dr1 ) == -1) goto error;
|
||||||
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(2), context->debug.i386_regs.dr2 ) == -1) goto error;
|
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(2), context->debug.i386_regs.dr2 ) == -1) goto error;
|
||||||
|
@ -646,7 +645,7 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign
|
||||||
thread->system_regs |= SERVER_CTX_DEBUG_REGISTERS;
|
thread->system_regs |= SERVER_CTX_DEBUG_REGISTERS;
|
||||||
break;
|
break;
|
||||||
case IMAGE_FILE_MACHINE_AMD64:
|
case IMAGE_FILE_MACHINE_AMD64:
|
||||||
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(7), context->debug.x86_64_regs.dr7 & 0xffff0000 ) == -1) goto error;
|
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(7), 0 ) == -1) goto error;
|
||||||
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(0), context->debug.x86_64_regs.dr0 ) == -1) goto error;
|
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(0), context->debug.x86_64_regs.dr0 ) == -1) goto error;
|
||||||
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(1), context->debug.x86_64_regs.dr1 ) == -1) goto error;
|
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(1), context->debug.x86_64_regs.dr1 ) == -1) goto error;
|
||||||
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(2), context->debug.x86_64_regs.dr2 ) == -1) goto error;
|
if (ptrace( PTRACE_POKEUSER, pid, DR_OFFSET(2), context->debug.x86_64_regs.dr2 ) == -1) goto error;
|
||||||
|
|
Loading…
Reference in a new issue