Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
cbb57052
Commit
cbb57052
authored
Oct 20, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Oct 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use wrapper function for consolidate callback on x86_64.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
effd2c41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
2 deletions
+61
-2
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+61
-2
No files found.
dlls/ntdll/signal_x86_64.c
View file @
cbb57052
...
...
@@ -3288,6 +3288,64 @@ static void call_teb_unwind_handler( EXCEPTION_RECORD *rec, DISPATCHER_CONTEXT *
}
/**********************************************************************
* call_consolidate_callback
*
* Wrapper function to call a consolidate callback from a fake frame.
* If the callback executes RtlUnwindEx (like for example done in C++ handlers),
* we have to skip all frames which were already processed. To do that we
* trick the unwinding functions into thinking the call came from somewhere
* else. All CFI instructions are either DW_CFA_def_cfa_expression or
* DW_CFA_expression, and the expressions have the following format:
*
* DW_OP_breg6; sleb128 0x10 | Load %rbp + 0x10
* DW_OP_deref | Get *(%rbp + 0x10) == context
* DW_OP_plus_uconst; uleb128 <OFFSET> | Add offset to get struct member
* [DW_OP_deref] | Dereference, only for CFA
*/
extern
void
*
WINAPI
call_consolidate_callback
(
CONTEXT
*
context
,
void
*
(
CALLBACK
*
callback
)(
EXCEPTION_RECORD
*
),
EXCEPTION_RECORD
*
rec
);
__ASM_GLOBAL_FUNC
(
call_consolidate_callback
,
"pushq %rbp
\n\t
"
__ASM_CFI
(
".cfi_adjust_cfa_offset 8
\n\t
"
)
__ASM_CFI
(
".cfi_rel_offset %rbp,0
\n\t
"
)
"movq %rsp,%rbp
\n\t
"
__ASM_CFI
(
".cfi_def_cfa_register %rbp
\n\t
"
)
"subq $0x20,%rsp
\n\t
"
"movq %rcx,0x10(%rbp)
\n\t
"
__ASM_CFI
(
".cfi_remember_state
\n\t
"
)
__ASM_CFI
(
".cfi_escape 0x0f,0x07,0x76,0x10,0x06,0x23,0x98,0x01,0x06
\n\t
"
)
/* CFA */
__ASM_CFI
(
".cfi_escape 0x10,0x03,0x06,0x76,0x10,0x06,0x23,0x90,0x01
\n\t
"
)
/* %rbx */
__ASM_CFI
(
".cfi_escape 0x10,0x04,0x06,0x76,0x10,0x06,0x23,0xa8,0x01
\n\t
"
)
/* %rsi */
__ASM_CFI
(
".cfi_escape 0x10,0x05,0x06,0x76,0x10,0x06,0x23,0xb0,0x01
\n\t
"
)
/* %rdi */
__ASM_CFI
(
".cfi_escape 0x10,0x06,0x06,0x76,0x10,0x06,0x23,0xa0,0x01
\n\t
"
)
/* %rbp */
__ASM_CFI
(
".cfi_escape 0x10,0x0c,0x06,0x76,0x10,0x06,0x23,0xd8,0x01
\n\t
"
)
/* %r12 */
__ASM_CFI
(
".cfi_escape 0x10,0x0d,0x06,0x76,0x10,0x06,0x23,0xe0,0x01
\n\t
"
)
/* %r13 */
__ASM_CFI
(
".cfi_escape 0x10,0x0e,0x06,0x76,0x10,0x06,0x23,0xe8,0x01
\n\t
"
)
/* %r14 */
__ASM_CFI
(
".cfi_escape 0x10,0x0f,0x06,0x76,0x10,0x06,0x23,0xf0,0x01
\n\t
"
)
/* %r15 */
__ASM_CFI
(
".cfi_escape 0x10,0x10,0x06,0x76,0x10,0x06,0x23,0xf8,0x01
\n\t
"
)
/* %rip */
__ASM_CFI
(
".cfi_escape 0x10,0x17,0x06,0x76,0x10,0x06,0x23,0x80,0x04
\n\t
"
)
/* %xmm6 */
__ASM_CFI
(
".cfi_escape 0x10,0x18,0x06,0x76,0x10,0x06,0x23,0x90,0x04
\n\t
"
)
/* %xmm7 */
__ASM_CFI
(
".cfi_escape 0x10,0x19,0x06,0x76,0x10,0x06,0x23,0xa0,0x04
\n\t
"
)
/* %xmm8 */
__ASM_CFI
(
".cfi_escape 0x10,0x1a,0x06,0x76,0x10,0x06,0x23,0xb0,0x04
\n\t
"
)
/* %xmm9 */
__ASM_CFI
(
".cfi_escape 0x10,0x1b,0x06,0x76,0x10,0x06,0x23,0xc0,0x04
\n\t
"
)
/* %xmm10 */
__ASM_CFI
(
".cfi_escape 0x10,0x1c,0x06,0x76,0x10,0x06,0x23,0xd0,0x04
\n\t
"
)
/* %xmm11 */
__ASM_CFI
(
".cfi_escape 0x10,0x1d,0x06,0x76,0x10,0x06,0x23,0xe0,0x04
\n\t
"
)
/* %xmm12 */
__ASM_CFI
(
".cfi_escape 0x10,0x1e,0x06,0x76,0x10,0x06,0x23,0xf0,0x04
\n\t
"
)
/* %xmm13 */
__ASM_CFI
(
".cfi_escape 0x10,0x1f,0x06,0x76,0x10,0x06,0x23,0x80,0x05
\n\t
"
)
/* %xmm14 */
__ASM_CFI
(
".cfi_escape 0x10,0x20,0x06,0x76,0x10,0x06,0x23,0x90,0x05
\n\t
"
)
/* %xmm15 */
"movq %r8,%rcx
\n\t
"
"callq *%rdx
\n\t
"
__ASM_CFI
(
".cfi_restore_state
\n\t
"
)
"movq %rbp,%rsp
\n\t
"
__ASM_CFI
(
".cfi_def_cfa_register %rsp
\n\t
"
)
"popq %rbp
\n\t
"
__ASM_CFI
(
".cfi_adjust_cfa_offset -8
\n\t
"
)
__ASM_CFI
(
".cfi_same_value %rbp
\n\t
"
)
"ret"
)
/*******************************************************************
* RtlUnwindEx (NTDLL.@)
*/
...
...
@@ -3474,8 +3532,9 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec
else
if
(
rec
->
ExceptionCode
==
STATUS_UNWIND_CONSOLIDATE
&&
rec
->
NumberParameters
>=
1
)
{
PVOID
(
CALLBACK
*
consolidate
)(
EXCEPTION_RECORD
*
)
=
(
void
*
)
rec
->
ExceptionInformation
[
0
];
TRACE
(
"calling consolidate callback %p
\n
"
,
consolidate
);
target_ip
=
consolidate
(
rec
);
TRACE
(
"calling consolidate callback %p (rec=%p)
\n
"
,
consolidate
,
rec
);
target_ip
=
call_consolidate_callback
(
context
,
consolidate
,
rec
);
TRACE
(
"-> target=%p
\n
"
,
target_ip
);
}
context
->
Rax
=
(
ULONG64
)
retval
;
context
->
Rip
=
(
ULONG64
)
target_ip
;
...
...
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