mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Added patch to translate icebp instruction to EXCEPTION_SINGLE_STEP on x86_64.
This commit is contained in:
parent
54b732863c
commit
b35d9813d2
@ -0,0 +1,42 @@
|
||||
From 9c89b126ffe944150dd643009b24b0140758fab3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 11 Sep 2017 03:07:45 +0200
|
||||
Subject: ntdll: Translate icebp instruction to EXCEPTION_SINGLE_STEP on x64.
|
||||
|
||||
---
|
||||
dlls/ntdll/signal_x86_64.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
|
||||
index f434775df00..2e1eac2d671 100644
|
||||
--- a/dlls/ntdll/signal_x86_64.c
|
||||
+++ b/dlls/ntdll/signal_x86_64.c
|
||||
@@ -2815,6 +2815,12 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
}
|
||||
}
|
||||
|
||||
+static inline DWORD is_icebp_instr( CONTEXT *context )
|
||||
+{
|
||||
+ const BYTE *instr = (BYTE *)context->Rip - 1;
|
||||
+ return (*instr == 0xf1) ? EXCEPTION_SINGLE_STEP : 0;
|
||||
+}
|
||||
+
|
||||
/**********************************************************************
|
||||
* trap_handler
|
||||
*
|
||||
@@ -2831,8 +2837,12 @@ static void trap_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
rec->ExceptionCode = EXCEPTION_SINGLE_STEP;
|
||||
break;
|
||||
case TRAP_BRKPT: /* Breakpoint exception */
|
||||
+ {
|
||||
+ CONTEXT *win_context = get_exception_context( rec );
|
||||
+ if ((rec->ExceptionCode = is_icebp_instr( win_context ))) break;
|
||||
rec->ExceptionAddress = (char *)rec->ExceptionAddress - 1; /* back up over the int3 instruction */
|
||||
/* fall through */
|
||||
+ }
|
||||
default:
|
||||
rec->ExceptionCode = EXCEPTION_BREAKPOINT;
|
||||
rec->NumberParameters = 1;
|
||||
--
|
||||
2.14.1
|
||||
|
1
patches/ntdll-Icebp_x86_64/definition
Normal file
1
patches/ntdll-Icebp_x86_64/definition
Normal file
@ -0,0 +1 @@
|
||||
Fixes: Translate icebp instruction to EXCEPTION_SINGLE_STEP on x86_64
|
@ -250,6 +250,7 @@ patch_enable_all ()
|
||||
enable_ntdll_HashLinks="$1"
|
||||
enable_ntdll_Heap_Improvements="$1"
|
||||
enable_ntdll_Hide_Wine_Exports="$1"
|
||||
enable_ntdll_Icebp_x86_64="$1"
|
||||
enable_ntdll_Interrupt_0x2e="$1"
|
||||
enable_ntdll_Junction_Points="$1"
|
||||
enable_ntdll_LDR_MODULE="$1"
|
||||
@ -1025,6 +1026,9 @@ patch_enable ()
|
||||
ntdll-Hide_Wine_Exports)
|
||||
enable_ntdll_Hide_Wine_Exports="$2"
|
||||
;;
|
||||
ntdll-Icebp_x86_64)
|
||||
enable_ntdll_Icebp_x86_64="$2"
|
||||
;;
|
||||
ntdll-Interrupt-0x2e)
|
||||
enable_ntdll_Interrupt_0x2e="$2"
|
||||
;;
|
||||
@ -6354,6 +6358,18 @@ if test "$enable_ntdll_Heap_Improvements" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntdll-Icebp_x86_64
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ntdll/signal_x86_64.c
|
||||
# |
|
||||
if test "$enable_ntdll_Icebp_x86_64" -eq 1; then
|
||||
patch_apply ntdll-Icebp_x86_64/0001-ntdll-Translate-icebp-instruction-to-EXCEPTION_SINGL.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "ntdll: Translate icebp instruction to EXCEPTION_SINGLE_STEP on x64.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntdll-Interrupt-0x2e
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
Loading…
x
Reference in New Issue
Block a user