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
37c24eab
Commit
37c24eab
authored
Jan 18, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Support Thumb mode in signal handling.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
54cd0e91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
+9
-19
signal_arm.c
dlls/ntdll/unix/signal_arm.c
+9
-19
No files found.
dlls/ntdll/unix/signal_arm.c
View file @
37c24eab
...
...
@@ -283,6 +283,7 @@ static void save_context( CONTEXT *context, const ucontext_t *sigcontext )
context
->
Cpsr
=
CPSR_sig
(
sigcontext
);
/* Current State Register */
context
->
R11
=
FP_sig
(
sigcontext
);
/* Frame pointer */
context
->
R12
=
IP_sig
(
sigcontext
);
/* Intra-Procedure-call scratch register */
if
(
CPSR_sig
(
sigcontext
)
&
0x20
)
context
->
Pc
|=
1
;
/* Thumb mode */
save_fpu
(
context
,
sigcontext
);
}
...
...
@@ -305,6 +306,8 @@ static void restore_context( const CONTEXT *context, ucontext_t *sigcontext )
CPSR_sig
(
sigcontext
)
=
context
->
Cpsr
;
/* Current State Register */
FP_sig
(
sigcontext
)
=
context
->
R11
;
/* Frame pointer */
IP_sig
(
sigcontext
)
=
context
->
R12
;
/* Intra-Procedure-call scratch register */
if
(
PC_sig
(
sigcontext
)
&
1
)
CPSR_sig
(
sigcontext
)
|=
0x20
;
else
CPSR_sig
(
sigcontext
)
&=
~
0x20
;
restore_fpu
(
context
,
sigcontext
);
}
...
...
@@ -534,19 +537,6 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
}
extern
void
raise_func_trampoline_thumb
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
void
*
func
);
__ASM_GLOBAL_FUNC
(
raise_func_trampoline_thumb
,
".thumb
\n\t
"
"bx r2
\n\t
"
"bkpt
\n\t
"
".arm"
)
extern
void
raise_func_trampoline_arm
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
void
*
func
);
__ASM_GLOBAL_FUNC
(
raise_func_trampoline_arm
,
".arm
\n\t
"
"bx r2
\n\t
"
"bkpt"
)
/***********************************************************************
* setup_exception
*
...
...
@@ -566,7 +556,8 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec )
rec
->
ExceptionAddress
=
(
void
*
)
PC_sig
(
sigcontext
);
save_context
(
&
context
,
sigcontext
);
if
(
rec
->
ExceptionCode
==
EXCEPTION_BREAKPOINT
)
context
.
Pc
+=
4
;
if
(
rec
->
ExceptionCode
==
EXCEPTION_BREAKPOINT
)
context
.
Pc
+=
CPSR_sig
(
sigcontext
)
&
0x20
?
2
:
4
;
status
=
send_debug_event
(
rec
,
&
context
,
TRUE
);
if
(
status
==
DBG_CONTINUE
||
status
==
DBG_EXCEPTION_HANDLED
)
...
...
@@ -581,13 +572,11 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec )
/* now modify the sigcontext to return to the raise function */
SP_sig
(
sigcontext
)
=
(
DWORD
)
stack
;
if
(
CPSR_sig
(
sigcontext
)
&
0x20
)
PC_sig
(
sigcontext
)
=
(
DWORD
)
raise_func_trampoline_thumb
;
else
PC_sig
(
sigcontext
)
=
(
DWORD
)
raise_func_trampoline_arm
;
PC_sig
(
sigcontext
)
=
(
DWORD
)
pKiUserExceptionDispatcher
;
if
(
PC_sig
(
sigcontext
)
&
1
)
CPSR_sig
(
sigcontext
)
|=
0x20
;
else
CPSR_sig
(
sigcontext
)
&=
~
0x20
;
REGn_sig
(
0
,
sigcontext
)
=
(
DWORD
)
&
stack
->
rec
;
/* first arg for KiUserExceptionDispatcher */
REGn_sig
(
1
,
sigcontext
)
=
(
DWORD
)
&
stack
->
context
;
/* second arg for KiUserExceptionDispatcher */
REGn_sig
(
2
,
sigcontext
)
=
(
DWORD
)
pKiUserExceptionDispatcher
;
}
...
...
@@ -999,6 +988,7 @@ static void init_thread_context( CONTEXT *context, LPTHREAD_START_ROUTINE entry,
context
->
R1
=
(
DWORD
)
arg
;
context
->
Sp
=
(
DWORD
)
teb
->
Tib
.
StackBase
;
context
->
Pc
=
(
DWORD
)
pRtlUserThreadStart
;
if
(
context
->
Pc
&
1
)
context
->
Cpsr
|=
0x20
;
/* thumb mode */
}
...
...
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