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
82dc024a
Commit
82dc024a
authored
Jul 15, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use separate handlers for SIGSEGV/SIGILL/SIGBUS on ARM64.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7b795324
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
29 deletions
+43
-29
signal_arm64.c
dlls/ntdll/unix/signal_arm64.c
+43
-29
No files found.
dlls/ntdll/unix/signal_arm64.c
View file @
82dc024a
...
@@ -69,7 +69,9 @@
...
@@ -69,7 +69,9 @@
#include "unix_private.h"
#include "unix_private.h"
#include "wine/debug.h"
#include "wine/debug.h"
#ifdef HAVE_LIBUNWIND
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
#endif
/***********************************************************************
/***********************************************************************
* signal context platform-specific definitions
* signal context platform-specific definitions
...
@@ -596,49 +598,59 @@ void WINAPI call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *cont
...
@@ -596,49 +598,59 @@ void WINAPI call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *cont
/**********************************************************************
/**********************************************************************
* segv_handler
* segv_handler
*
*
* Handler for SIGSEGV
and related errors
.
* Handler for SIGSEGV.
*/
*/
static
void
segv_handler
(
int
signal
,
siginfo_t
*
info
,
void
*
u
context
)
static
void
segv_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sig
context
)
{
{
EXCEPTION_RECORD
rec
=
{
0
};
EXCEPTION_RECORD
rec
=
{
0
};
ucontext_t
*
context
=
ucontext
;
ucontext_t
*
context
=
sigcontext
;
switch
(
signal
)
rec
.
NumberParameters
=
2
;
{
rec
.
ExceptionInformation
[
0
]
=
(
get_fault_esr
(
context
)
&
0x40
)
!=
0
;
case
SIGILL
:
/* Invalid opcode exception */
rec
.
ExceptionInformation
[
1
]
=
(
ULONG_PTR
)
siginfo
->
si_addr
;
rec
.
ExceptionCode
=
EXCEPTION_ILLEGAL_INSTRUCTION
;
rec
.
ExceptionCode
=
virtual_handle_fault
(
siginfo
->
si_addr
,
rec
.
ExceptionInformation
[
0
],
break
;
(
void
*
)
SP_sig
(
context
)
);
case
SIGSEGV
:
/* Segmentation fault */
if
(
!
rec
.
ExceptionCode
)
return
;
rec
.
NumberParameters
=
2
;
rec
.
ExceptionInformation
[
0
]
=
(
get_fault_esr
(
context
)
&
0x40
)
!=
0
;
rec
.
ExceptionInformation
[
1
]
=
(
ULONG_PTR
)
info
->
si_addr
;
rec
.
ExceptionCode
=
virtual_handle_fault
(
info
->
si_addr
,
rec
.
ExceptionInformation
[
0
],
(
void
*
)
SP_sig
(
context
)
);
if
(
!
rec
.
ExceptionCode
)
return
;
break
;
case
SIGBUS
:
/* Alignment check exception */
rec
.
ExceptionCode
=
EXCEPTION_DATATYPE_MISALIGNMENT
;
break
;
default
:
ERR
(
"Got unexpected signal %i
\n
"
,
signal
);
rec
.
ExceptionCode
=
EXCEPTION_ILLEGAL_INSTRUCTION
;
break
;
}
setup_exception
(
context
,
&
rec
);
setup_exception
(
context
,
&
rec
);
}
}
/**********************************************************************
/**********************************************************************
* ill_handler
*
* Handler for SIGILL.
*/
static
void
ill_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sigcontext
)
{
EXCEPTION_RECORD
rec
=
{
EXCEPTION_ILLEGAL_INSTRUCTION
};
setup_exception
(
sigcontext
,
&
rec
);
}
/**********************************************************************
* bus_handler
*
* Handler for SIGBUS.
*/
static
void
bus_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sigcontext
)
{
EXCEPTION_RECORD
rec
=
{
EXCEPTION_DATATYPE_MISALIGNMENT
};
setup_exception
(
sigcontext
,
&
rec
);
}
/**********************************************************************
* trap_handler
* trap_handler
*
*
* Handler for SIGTRAP.
* Handler for SIGTRAP.
*/
*/
static
void
trap_handler
(
int
signal
,
siginfo_t
*
info
,
void
*
u
context
)
static
void
trap_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sig
context
)
{
{
EXCEPTION_RECORD
rec
=
{
0
};
EXCEPTION_RECORD
rec
=
{
0
};
ucontext_t
*
context
=
ucontext
;
switch
(
info
->
si_code
)
switch
(
sig
info
->
si_code
)
{
{
case
TRAP_TRACE
:
case
TRAP_TRACE
:
rec
.
ExceptionCode
=
EXCEPTION_SINGLE_STEP
;
rec
.
ExceptionCode
=
EXCEPTION_SINGLE_STEP
;
...
@@ -648,7 +660,7 @@ static void trap_handler( int signal, siginfo_t *info, void *ucontext )
...
@@ -648,7 +660,7 @@ static void trap_handler( int signal, siginfo_t *info, void *ucontext )
rec
.
ExceptionCode
=
EXCEPTION_BREAKPOINT
;
rec
.
ExceptionCode
=
EXCEPTION_BREAKPOINT
;
break
;
break
;
}
}
setup_exception
(
context
,
&
rec
);
setup_exception
(
sig
context
,
&
rec
);
}
}
...
@@ -859,7 +871,9 @@ void signal_init_process(void)
...
@@ -859,7 +871,9 @@ void signal_init_process(void)
if
(
sigaction
(
SIGTRAP
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
if
(
sigaction
(
SIGTRAP
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
sig_act
.
sa_sigaction
=
segv_handler
;
sig_act
.
sa_sigaction
=
segv_handler
;
if
(
sigaction
(
SIGSEGV
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
if
(
sigaction
(
SIGSEGV
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
sig_act
.
sa_sigaction
=
ill_handler
;
if
(
sigaction
(
SIGILL
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
if
(
sigaction
(
SIGILL
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
sig_act
.
sa_sigaction
=
bus_handler
;
if
(
sigaction
(
SIGBUS
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
if
(
sigaction
(
SIGBUS
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
return
;
return
;
...
...
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