Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
649be380
Commit
649be380
authored
Sep 04, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Call send_debug_event from debug handler on x86_64.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
200490b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
11 deletions
+32
-11
debugger.c
dlls/kernel32/tests/debugger.c
+1
-1
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+31
-10
No files found.
dlls/kernel32/tests/debugger.c
View file @
649be380
...
...
@@ -1357,7 +1357,7 @@ static void test_debugger(const char *argv0)
}
else
win_skip
(
"call_debug_service_code not supported on this architecture
\n
"
);
if
(
sizeof
(
loop_code
)
>
1
&&
broken
(
1
)
/* FIXME: broken in Wine */
)
if
(
sizeof
(
loop_code
)
>
1
&&
(
sizeof
(
void
*
)
==
8
||
broken
(
1
)
/* FIXME: broken in Wine */
)
)
{
memset
(
buf
,
OP_BP
,
sizeof
(
buf
));
memcpy
(
proc_code
,
&
loop_code
,
sizeof
(
loop_code
));
...
...
dlls/ntdll/signal_x86_64.c
View file @
649be380
...
...
@@ -2577,10 +2577,7 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex
}
/*******************************************************************
* NtRaiseException (NTDLL.@)
*/
NTSTATUS
WINAPI
NtRaiseException
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
BOOL
first_chance
)
static
NTSTATUS
raise_exception
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
BOOL
first_chance
)
{
NTSTATUS
status
;
...
...
@@ -2615,8 +2612,6 @@ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL
TRACE
(
" r12=%016lx r13=%016lx r14=%016lx r15=%016lx
\n
"
,
context
->
R12
,
context
->
R13
,
context
->
R14
,
context
->
R15
);
}
status
=
send_debug_event
(
rec
,
TRUE
,
context
);
if
(
status
==
DBG_CONTINUE
||
status
==
DBG_EXCEPTION_HANDLED
)
goto
done
;
/* fix up instruction pointer in context for EXCEPTION_BREAKPOINT */
if
(
rec
->
ExceptionCode
==
EXCEPTION_BREAKPOINT
)
context
->
Rip
--
;
...
...
@@ -2647,6 +2642,24 @@ done:
}
/*******************************************************************
* NtRaiseException (NTDLL.@)
*/
NTSTATUS
WINAPI
NtRaiseException
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
BOOL
first_chance
)
{
NTSTATUS
status
;
if
(
first_chance
)
{
status
=
send_debug_event
(
rec
,
TRUE
,
context
);
if
(
status
==
DBG_CONTINUE
||
status
==
DBG_EXCEPTION_HANDLED
)
return
NtSetContextThread
(
GetCurrentThread
(),
context
);
}
return
raise_exception
(
rec
,
context
,
first_chance
);
}
/**********************************************************************
* raise_generic_exception
*
...
...
@@ -2763,6 +2776,7 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec
{
struct
stack_layout
*
stack
=
CONTAINING_RECORD
(
rec
,
struct
stack_layout
,
rec
);
ULONG64
*
rsp_ptr
;
NTSTATUS
status
;
if
(
rec
->
ExceptionCode
==
EXCEPTION_SINGLE_STEP
)
{
...
...
@@ -2782,12 +2796,19 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec
stack
->
context
.
EFlags
&=
~
0x100
;
/* clear single-step flag */
}
status
=
send_debug_event
(
rec
,
TRUE
,
&
stack
->
context
);
if
(
status
==
DBG_CONTINUE
||
status
==
DBG_EXCEPTION_HANDLED
)
{
restore_context
(
&
stack
->
context
,
sigcontext
);
return
;
}
/* store return address and %rbp without aligning, so that the offset is fixed */
rsp_ptr
=
(
ULONG64
*
)
RSP_sig
(
sigcontext
)
-
16
;
*
(
--
rsp_ptr
)
=
RIP_sig
(
sigcontext
)
;
*
(
--
rsp_ptr
)
=
RBP_sig
(
sigcontext
)
;
*
(
--
rsp_ptr
)
=
RDI_sig
(
sigcontext
)
;
*
(
--
rsp_ptr
)
=
RSI_sig
(
sigcontext
)
;
*
(
--
rsp_ptr
)
=
stack
->
context
.
Rip
;
*
(
--
rsp_ptr
)
=
stack
->
context
.
Rbp
;
*
(
--
rsp_ptr
)
=
stack
->
context
.
Rdi
;
*
(
--
rsp_ptr
)
=
stack
->
context
.
Rsi
;
/* now modify the sigcontext to return to the raise function */
RIP_sig
(
sigcontext
)
=
(
ULONG_PTR
)
raise_func_trampoline
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment