server-Debug_Registers: Remove disabled patchset.

This commit is contained in:
Sebastian Lackner 2017-09-08 02:33:32 +02:00
parent 97015ebf4e
commit 2a9948a07f
2 changed files with 0 additions and 74 deletions

View File

@ -1,72 +0,0 @@
From 6e095ddd83997fe8e1389d1b29471d20526f56f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 6 May 2017 00:10:01 +0200
Subject: server: Reset debug registers when creating threads.
---
dlls/ntdll/tests/exception.c | 10 +++++-----
server/thread.c | 6 ++++++
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index e24bd54f00c..ab193267528 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -905,7 +905,7 @@ static void test_exceptions(void)
res = pNtGetContextThread( h, &ctx );
ok( res == STATUS_SUCCESS, "NtGetContextThread failed with %x\n", res );
ok( ctx.Dr0 == 0, "dr0 %x\n", ctx.Dr0 );
- todo_wine ok( ctx.Dr7 == 0, "dr7 %x\n", ctx.Dr7 );
+ ok( ctx.Dr7 == 0, "dr7 %x\n", ctx.Dr7 );
ctx.Dr0 = (DWORD)code_mem;
ctx.Dr7 = 3;
res = pNtSetContextThread( h, &ctx );
@@ -2181,8 +2181,8 @@ static DWORD WINAPI register_check_thread(void *arg)
ok(!ctx.Dr1, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr1);
ok(!ctx.Dr2, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr2);
ok(!ctx.Dr3, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr3);
- todo_wine ok(!ctx.Dr6, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr6);
- todo_wine ok(!ctx.Dr7, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr7);
+ ok(!ctx.Dr6, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr6);
+ ok(!ctx.Dr7, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr7);
return 0;
}
@@ -2251,8 +2251,8 @@ static void test_debug_registers(void)
ok(!ctx.Dr1, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr1);
ok(!ctx.Dr2, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr2);
ok(!ctx.Dr3, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr3);
- todo_wine ok(!ctx.Dr6, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr6);
- todo_wine ok(!ctx.Dr7, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr7);
+ ok(!ctx.Dr6, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr6);
+ ok(!ctx.Dr7, "expected 0, got %lx\n", (DWORD_PTR)ctx.Dr7);
ResumeThread(thread);
WaitForSingleObject(thread, 10000);
diff --git a/server/thread.c b/server/thread.c
index 211d0050b09..933eb35e07c 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1299,6 +1299,7 @@ DECL_HANDLER(new_thread)
/* initialize a new thread */
DECL_HANDLER(init_thread)
{
+ static const context_t zero_context;
struct process *process = current->process;
int wait_fd, reply_fd;
@@ -1357,6 +1358,11 @@ DECL_HANDLER(init_thread)
}
if (process->unix_pid != current->unix_pid)
process->unix_pid = -1; /* can happen with linuxthreads */
+
+ /* Linux preserves dr6/dr7 and FreeBSD all debug registers (unlike windows) */
+ set_thread_context( current, &zero_context, SERVER_CTX_DEBUG_REGISTERS );
+ clear_error(); /* ignore error */
+
stop_thread_if_suspended( current );
generate_debug_event( current, CREATE_THREAD_DEBUG_EVENT, &req->entry );
set_thread_affinity( current, current->affinity );
--
2.13.1

View File

@ -1,2 +0,0 @@
# Fixes: [38322] Reset debug registers when creating threads
Disabled: true