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
c152b4e7
Commit
c152b4e7
authored
Jun 18, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Add a target address for unwinding for platforms that need it.
parent
c9deac11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
21 deletions
+44
-21
exception.h
include/wine/exception.h
+30
-10
typegen.c
tools/widl/typegen.c
+14
-11
No files found.
include/wine/exception.h
View file @
c152b4e7
...
...
@@ -213,6 +213,18 @@ static inline EXCEPTION_REGISTRATION_RECORD *__wine_pop_frame( EXCEPTION_REGISTR
#endif
}
static
inline
EXCEPTION_REGISTRATION_RECORD
*
__wine_get_frame
(
void
)
{
#if defined(__GNUC__) && defined(__i386__)
EXCEPTION_REGISTRATION_RECORD
*
ret
;
__asm__
__volatile__
(
".byte 0x64
\n\t
movl (0),%0"
:
"=r"
(
ret
)
);
return
ret
;
#else
NT_TIB
*
teb
=
(
NT_TIB
*
)
NtCurrentTeb
();
return
teb
->
ExceptionList
;
#endif
}
/* Exception handling flags - from OS/2 2.0 exception handling */
/* Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD */
...
...
@@ -238,26 +250,36 @@ extern void __wine_enter_vm86( CONTEXT *context );
NTSYSAPI
void
WINAPI
RtlUnwind
(
PVOID
,
PVOID
,
PEXCEPTION_RECORD
,
PVOID
);
static
inline
void
DECLSPEC_NORETURN
__wine_unwind_target
(
void
)
{
__WINE_FRAME
*
wine_frame
=
(
__WINE_FRAME
*
)
__wine_get_frame
();
__wine_pop_frame
(
&
wine_frame
->
frame
);
siglongjmp
(
wine_frame
->
jmp
,
1
);
}
/* wrapper for RtlUnwind since it clobbers registers on Windows */
static
inline
void
__wine_rtl_unwind
(
EXCEPTION_REGISTRATION_RECORD
*
frame
,
EXCEPTION_RECORD
*
record
)
static
inline
void
DECLSPEC_NORETURN
__wine_rtl_unwind
(
EXCEPTION_REGISTRATION_RECORD
*
frame
,
EXCEPTION_RECORD
*
record
,
void
(
*
target
)(
void
)
)
{
#if defined(__GNUC__) && defined(__i386__)
int
dummy1
,
dummy2
,
dummy3
;
int
dummy1
,
dummy2
,
dummy3
,
dummy4
;
__asm__
__volatile__
(
"pushl %%ebp
\n\t
"
"pushl %%ebx
\n\t
"
"pushl $0
\n\t
"
"pushl %3
\n\t
"
"pushl %2
\n\t
"
"pushl $0
\n\t
"
"pushl %1
\n\t
"
"call *%0
\n\t
"
"popl %%ebx
\n\t
"
"popl %%ebp"
:
"=a"
(
dummy1
),
"=S"
(
dummy2
),
"=D"
(
dummy3
)
:
"0"
(
RtlUnwind
),
"1"
(
frame
),
"2"
(
record
)
:
"e
cx"
,
"e
dx"
,
"memory"
);
:
"=a"
(
dummy1
),
"=S"
(
dummy2
),
"=D"
(
dummy3
)
,
"=c"
(
dummy4
)
:
"0"
(
RtlUnwind
),
"1"
(
frame
),
"2"
(
target
),
"3"
(
record
)
:
"edx"
,
"memory"
);
#else
RtlUnwind
(
frame
,
0
,
record
,
0
);
RtlUnwind
(
frame
,
target
,
record
,
0
);
#endif
for
(;;)
target
();
}
static
inline
void
DECLSPEC_NORETURN
__wine_unwind_frame
(
EXCEPTION_RECORD
*
record
,
...
...
@@ -269,9 +291,7 @@ static inline void DECLSPEC_NORETURN __wine_unwind_frame( EXCEPTION_RECORD *reco
wine_frame
->
ExceptionCode
=
record
->
ExceptionCode
;
wine_frame
->
ExceptionRecord
=
wine_frame
;
__wine_rtl_unwind
(
frame
,
record
);
__wine_pop_frame
(
frame
);
siglongjmp
(
wine_frame
->
jmp
,
1
);
__wine_rtl_unwind
(
frame
,
record
,
__wine_unwind_target
);
}
static
inline
DWORD
__wine_exception_handler
(
EXCEPTION_RECORD
*
record
,
...
...
tools/widl/typegen.c
View file @
c152b4e7
...
...
@@ -3989,6 +3989,19 @@ void write_exceptions( FILE *file )
fprintf
(
file
,
" __DECL_EXCEPTION_FRAME
\n
"
);
fprintf
(
file
,
"};
\n
"
);
fprintf
(
file
,
"
\n
"
);
fprintf
(
file
,
"static inline void __widl_unwind_target(void)
\n
"
);
fprintf
(
file
,
"{
\n
"
);
fprintf
(
file
,
" struct __exception_frame *exc_frame = (struct __exception_frame *)__wine_get_frame();
\n
"
);
fprintf
(
file
,
" if (exc_frame->finally_level > exc_frame->filter_level)
\n
"
);
fprintf
(
file
,
" {
\n
"
);
fprintf
(
file
,
" exc_frame->abnormal_termination = 1;
\n
"
);
fprintf
(
file
,
" exc_frame->finally( exc_frame );
\n
"
);
fprintf
(
file
,
" __wine_pop_frame( &exc_frame->frame );
\n
"
);
fprintf
(
file
,
" }
\n
"
);
fprintf
(
file
,
" exc_frame->filter_level = 0;
\n
"
);
fprintf
(
file
,
" siglongjmp( exc_frame->jmp, 1 );
\n
"
);
fprintf
(
file
,
"}
\n
"
);
fprintf
(
file
,
"
\n
"
);
fprintf
(
file
,
"static DWORD __widl_exception_handler( EXCEPTION_RECORD *record,
\n
"
);
fprintf
(
file
,
" EXCEPTION_REGISTRATION_RECORD *frame,
\n
"
);
fprintf
(
file
,
" CONTEXT *context,
\n
"
);
...
...
@@ -4007,17 +4020,7 @@ void write_exceptions( FILE *file )
fprintf
(
file
,
" }
\n
"
);
fprintf
(
file
,
" exc_frame->code = record->ExceptionCode;
\n
"
);
fprintf
(
file
,
" if (exc_frame->filter_level && exc_frame->filter( record, exc_frame ) == EXCEPTION_EXECUTE_HANDLER)
\n
"
);
fprintf
(
file
,
" {
\n
"
);
fprintf
(
file
,
" __wine_rtl_unwind( frame, record );
\n
"
);
fprintf
(
file
,
" if (exc_frame->finally_level > exc_frame->filter_level)
\n
"
);
fprintf
(
file
,
" {
\n
"
);
fprintf
(
file
,
" exc_frame->abnormal_termination = 1;
\n
"
);
fprintf
(
file
,
" exc_frame->finally( exc_frame );
\n
"
);
fprintf
(
file
,
" __wine_pop_frame( frame );
\n
"
);
fprintf
(
file
,
" }
\n
"
);
fprintf
(
file
,
" exc_frame->filter_level = 0;
\n
"
);
fprintf
(
file
,
" siglongjmp( exc_frame->jmp, 1 );
\n
"
);
fprintf
(
file
,
" }
\n
"
);
fprintf
(
file
,
" __wine_rtl_unwind( frame, record, __widl_unwind_target );
\n
"
);
fprintf
(
file
,
" return ExceptionContinueSearch;
\n
"
);
fprintf
(
file
,
"}
\n
"
);
fprintf
(
file
,
"
\n
"
);
...
...
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