Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7ee66b29
Commit
7ee66b29
authored
Sep 18, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Send first chance debug event while on signal stack on i386.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d299087d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
signal_i386.c
dlls/ntdll/signal_i386.c
+22
-15
No files found.
dlls/ntdll/signal_i386.c
View file @
7ee66b29
...
...
@@ -724,18 +724,14 @@ static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL f
context
->
Ebp
,
context
->
Esp
,
context
->
SegCs
,
context
->
SegDs
,
context
->
SegEs
,
context
->
SegFs
,
context
->
SegGs
,
context
->
EFlags
);
}
status
=
send_debug_event
(
rec
,
TRUE
,
context
);
if
(
status
==
DBG_CONTINUE
||
status
==
DBG_EXCEPTION_HANDLED
)
return
STATUS_SUCCESS
;
/* fix up instruction pointer in context for EXCEPTION_BREAKPOINT */
if
(
rec
->
ExceptionCode
==
EXCEPTION_BREAKPOINT
)
context
->
Eip
--
;
if
(
call_vectored_handlers
(
rec
,
context
)
==
EXCEPTION_CONTINUE_EXECUTION
)
return
STATUS_SUCCESS
;
if
(
call_vectored_handlers
(
rec
,
context
)
==
EXCEPTION_CONTINUE_EXECUTION
)
goto
done
;
if
((
status
=
call_stack_handlers
(
rec
,
context
))
!=
STATUS_UNHANDLED_EXCEPTION
)
return
status
;
if
((
status
=
call_stack_handlers
(
rec
,
context
))
==
STATUS_SUCCESS
)
goto
done
;
if
(
status
!=
STATUS_UNHANDLED_EXCEPTION
)
return
status
;
}
/* last chance exception */
...
...
@@ -752,7 +748,8 @@ static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL f
rec
->
ExceptionCode
,
rec
->
ExceptionFlags
,
rec
->
ExceptionAddress
);
NtTerminateProcess
(
NtCurrentProcess
(),
rec
->
ExceptionCode
);
}
return
STATUS_SUCCESS
;
done:
return
NtSetContextThread
(
GetCurrentThread
(),
context
);
}
...
...
@@ -1860,7 +1857,7 @@ static void WINAPI raise_generic_exception( EXCEPTION_RECORD *rec, CONTEXT *cont
{
NTSTATUS
status
;
status
=
NtRaiseE
xception
(
rec
,
context
,
TRUE
);
status
=
raise_e
xception
(
rec
,
context
,
TRUE
);
raise_status
(
status
,
rec
);
}
...
...
@@ -1872,6 +1869,13 @@ static void WINAPI raise_generic_exception( EXCEPTION_RECORD *rec, CONTEXT *cont
*/
static
void
setup_raise_exception
(
ucontext_t
*
sigcontext
,
struct
stack_layout
*
stack
)
{
NTSTATUS
status
=
send_debug_event
(
&
stack
->
rec
,
TRUE
,
&
stack
->
context
);
if
(
status
==
DBG_CONTINUE
||
status
==
DBG_EXCEPTION_HANDLED
)
{
restore_context
(
&
stack
->
context
,
sigcontext
);
return
;
}
ESP_sig
(
sigcontext
)
=
(
DWORD
)
stack
;
EIP_sig
(
sigcontext
)
=
(
DWORD
)
raise_generic_exception
;
/* clear single-step, direction, and align check flag */
...
...
@@ -2499,9 +2503,13 @@ __ASM_STDCALL_FUNC( RtlUnwind, 16,
*/
NTSTATUS
WINAPI
NtRaiseException
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
BOOL
first_chance
)
{
NTSTATUS
status
=
raise_exception
(
rec
,
context
,
first_chance
);
if
(
status
==
STATUS_SUCCESS
)
NtSetContextThread
(
GetCurrentThread
(),
context
);
return
status
;
if
(
first_chance
)
{
NTSTATUS
status
=
send_debug_event
(
rec
,
TRUE
,
context
);
if
(
status
==
DBG_CONTINUE
||
status
==
DBG_EXCEPTION_HANDLED
)
NtSetContextThread
(
GetCurrentThread
(),
context
);
}
return
raise_exception
(
rec
,
context
,
first_chance
);
}
...
...
@@ -2510,7 +2518,7 @@ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL
*
* Raise an exception with the full CPU context.
*/
void
raise_exception_full_context
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
BOOL
first_chance
)
void
raise_exception_full_context
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
)
{
save_fpu
(
context
);
save_fpux
(
context
);
...
...
@@ -2523,7 +2531,7 @@ void raise_exception_full_context( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL
context
->
Dr7
=
x86_thread_data
()
->
dr7
;
context
->
ContextFlags
|=
CONTEXT_DEBUG_REGISTERS
;
RtlRaiseStatus
(
NtRaiseException
(
rec
,
context
,
first_chance
));
RtlRaiseStatus
(
NtRaiseException
(
rec
,
context
,
TRUE
));
}
...
...
@@ -2545,7 +2553,6 @@ __ASM_STDCALL_FUNC( RtlRaiseException, 4,
"leal 12(%ebp),%eax
\n\t
"
"movl %eax,0xc4(%esp)
\n\t
"
/* context->Esp */
"movl %esp,%eax
\n\t
"
"pushl $1
\n\t
"
"pushl %eax
\n\t
"
"pushl %ecx
\n\t
"
"call "
__ASM_NAME
(
"raise_exception_full_context"
)
"
\n\t
"
...
...
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