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
9f555cde
Commit
9f555cde
authored
Feb 22, 2024
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Handle leaf functions in RtlVirtualUnwind on ARM64.
parent
852e2ffc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
26 deletions
+24
-26
signal_arm64.c
dlls/ntdll/signal_arm64.c
+14
-24
unwind.c
dlls/ntdll/tests/unwind.c
+0
-0
unwind.c
dlls/ntdll/unwind.c
+10
-2
No files found.
dlls/ntdll/signal_arm64.c
View file @
9f555cde
...
...
@@ -147,33 +147,23 @@ __ASM_GLOBAL_FUNC( RtlCaptureContext,
*/
static
NTSTATUS
virtual_unwind
(
ULONG
type
,
DISPATCHER_CONTEXT
*
dispatch
,
CONTEXT
*
context
)
{
NTSTATUS
status
;
DWORD64
pc
;
DWORD64
pc
=
context
->
Pc
;
dispatch
->
ImageBase
=
0
;
dispatch
->
ScopeIndex
=
0
;
dispatch
->
EstablisherFrame
=
0
;
dispatch
->
ControlPc
=
context
->
Pc
;
dispatch
->
ScopeIndex
=
0
;
dispatch
->
ControlPc
=
pc
;
dispatch
->
ControlPcIsUnwound
=
(
context
->
ContextFlags
&
CONTEXT_UNWOUND_TO_CALL
)
!=
0
;
pc
=
context
->
Pc
-
(
dispatch
->
ControlPcIsUnwound
?
4
:
0
)
;
if
(
dispatch
->
ControlPcIsUnwound
)
pc
-=
4
;
if
((
dispatch
->
FunctionEntry
=
RtlLookupFunctionEntry
(
pc
,
&
dispatch
->
ImageBase
,
dispatch
->
HistoryTable
)))
dispatch
->
FunctionEntry
=
RtlLookupFunctionEntry
(
pc
,
&
dispatch
->
ImageBase
,
dispatch
->
HistoryTable
);
dispatch
->
LanguageHandler
=
RtlVirtualUnwind
(
type
,
dispatch
->
ImageBase
,
pc
,
dispatch
->
FunctionEntry
,
context
,
&
dispatch
->
HandlerData
,
&
dispatch
->
EstablisherFrame
,
NULL
);
if
(
!
context
->
Pc
)
{
dispatch
->
LanguageHandler
=
RtlVirtualUnwind
(
type
,
dispatch
->
ImageBase
,
pc
,
dispatch
->
FunctionEntry
,
context
,
&
dispatch
->
HandlerData
,
&
dispatch
->
EstablisherFrame
,
NULL
);
return
STATUS_SUCCESS
;
WARN
(
"exception data not found for pc %p, lr %p
\n
"
,
(
void
*
)
pc
,
(
void
*
)
context
->
Lr
);
return
STATUS_INVALID_DISPOSITION
;
}
WARN
(
"exception data not found for pc %p, lr %p
\n
"
,
(
void
*
)
context
->
Pc
,
(
void
*
)
context
->
Lr
);
status
=
context
->
Pc
!=
context
->
Lr
?
STATUS_SUCCESS
:
STATUS_INVALID_DISPOSITION
;
dispatch
->
EstablisherFrame
=
context
->
Sp
;
dispatch
->
LanguageHandler
=
NULL
;
context
->
Pc
=
context
->
Lr
;
context
->
ContextFlags
|=
CONTEXT_UNWOUND_TO_CALL
;
return
status
;
return
STATUS_SUCCESS
;
}
...
...
@@ -383,7 +373,7 @@ NTSTATUS call_seh_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_context )
break
;
case
ExceptionNestedException
:
rec
->
ExceptionFlags
|=
EH_NESTED_CALL
;
TRACE
_
(
seh
)
(
"nested exception
\n
"
);
TRACE
(
"nested exception
\n
"
);
break
;
case
ExceptionCollidedUnwind
:
{
ULONG64
frame
;
...
...
@@ -414,7 +404,7 @@ NTSTATUS call_seh_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_context )
break
;
case
ExceptionNestedException
:
rec
->
ExceptionFlags
|=
EH_NESTED_CALL
;
TRACE
_
(
seh
)
(
"nested exception
\n
"
);
TRACE
(
"nested exception
\n
"
);
break
;
case
ExceptionCollidedUnwind
:
{
ULONG64
frame
;
...
...
dlls/ntdll/tests/unwind.c
View file @
9f555cde
This diff is collapsed.
Click to expand it.
dlls/ntdll/unwind.c
View file @
9f555cde
...
...
@@ -779,12 +779,20 @@ PVOID WINAPI RtlVirtualUnwind( ULONG type, ULONG_PTR base, ULONG_PTR pc,
{
void
*
handler
;
TRACE
(
"type %lx pc %I64x sp %I64x func %I64x
\n
"
,
type
,
pc
,
context
->
Sp
,
base
+
func
->
BeginAddress
);
TRACE
(
"type %lx pc %I64x sp %I64x
\n
"
,
type
,
pc
,
context
->
Sp
);
if
(
!
func
&&
pc
==
context
->
Lr
)
/* invalid leaf function */
{
context
->
Pc
=
0
;
return
NULL
;
}
*
handler_data
=
NULL
;
context
->
ContextFlags
|=
CONTEXT_UNWOUND_TO_CALL
;
if
(
func
->
Flag
)
if
(
!
func
)
/* leaf function */
handler
=
NULL
;
else
if
(
func
->
Flag
)
handler
=
unwind_packed_data
(
base
,
pc
,
func
,
context
,
ctx_ptr
);
else
handler
=
unwind_full_data
(
base
,
pc
,
func
,
context
,
handler_data
,
ctx_ptr
);
...
...
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