Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
fix: _EH4_GlobalUnwind2
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroKaku committed Jun 17, 2022
1 parent 6e42710 commit 5a877f6
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 16 deletions.
8 changes: 8 additions & 0 deletions msvc/ucxxrt.test.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -153,41 +153,49 @@
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(Platform).$(Configuration)\</IntDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(Platform).$(Configuration)\</IntDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(Platform).$(Configuration)\</IntDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(Platform).$(Configuration)\</IntDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Link />
Expand Down
36 changes: 36 additions & 0 deletions msvc/ucxxrt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,42 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
</ClCompile>
<MASM Include="..\src\crt\i386\exsup.asm">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</MASM>
<MASM Include="..\src\crt\i386\exsup2.asm">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</MASM>
<MASM Include="..\src\crt\i386\exsup3.asm">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</MASM>
<MASM Include="..\src\crt\i386\exsup4.asm">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</MASM>
<ClCompile Include="..\src\crt\i386\trnsctrl.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
Expand Down
12 changes: 12 additions & 0 deletions msvc/ucxxrt.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -780,5 +780,17 @@
<MASM Include="..\src\crt\x64\handlers.asm">
<Filter>ucxxrt\crt\x64</Filter>
</MASM>
<MASM Include="..\src\crt\i386\exsup4.asm">
<Filter>ucxxrt\crt\i386</Filter>
</MASM>
<MASM Include="..\src\crt\i386\exsup.asm">
<Filter>ucxxrt\crt\i386</Filter>
</MASM>
<MASM Include="..\src\crt\i386\exsup2.asm">
<Filter>ucxxrt\crt\i386</Filter>
</MASM>
<MASM Include="..\src\crt\i386\exsup3.asm">
<Filter>ucxxrt\crt\i386</Filter>
</MASM>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/crt/i386/ehprolg2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#ifdef __cplusplus
extern "C"
#endif
void __declspec(naked) _EH_prolog2(void)
void __declspec(naked) __cdecl _EH_prolog2(void)
{
/*
* We want to generate a frame that is equivalent to
Expand Down
14 changes: 7 additions & 7 deletions src/crt/i386/ehprolg3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_prolog3(
unsigned long LocalAllocation
)
Expand Down Expand Up @@ -200,7 +200,7 @@ _EH_prolog3(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_prolog3_catch(
unsigned long LocalAllocation
)
Expand Down Expand Up @@ -319,7 +319,7 @@ _EH_prolog3_catch(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_prolog3_GS(
unsigned long LocalAllocation
)
Expand Down Expand Up @@ -441,7 +441,7 @@ _EH_prolog3_GS(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_prolog3_catch_GS(
unsigned long LocalAllocation
)
Expand Down Expand Up @@ -537,7 +537,7 @@ _EH_prolog3_catch_GS(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_epilog3(
void
)
Expand Down Expand Up @@ -581,7 +581,7 @@ _EH_epilog3(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_epilog3_GS(
void
)
Expand Down Expand Up @@ -618,7 +618,7 @@ _EH_epilog3_GS(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_epilog3_catch_GS(
void
)
Expand Down
12 changes: 6 additions & 6 deletions src/crt/i386/ehprolg3a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_prolog3_align(
unsigned long LocalAllocation,
unsigned long Alignment
Expand Down Expand Up @@ -272,7 +272,7 @@ _EH_prolog3_align(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_prolog3_catch_align(
unsigned long LocalAllocation,
unsigned long Alignment
Expand Down Expand Up @@ -457,7 +457,7 @@ _EH_prolog3_catch_align(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_prolog3_GS_align(
unsigned long LocalAllocation,
unsigned long Alignment
Expand Down Expand Up @@ -649,7 +649,7 @@ _EH_prolog3_GS_align(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_prolog3_catch_GS_align(
unsigned long LocalAllocation,
unsigned long Alignment
Expand Down Expand Up @@ -811,7 +811,7 @@ _EH_prolog3_catch_GS_align(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_epilog3_align(
void
)
Expand Down Expand Up @@ -862,7 +862,7 @@ _EH_epilog3_align(
#ifdef __cplusplus
extern "C"
#endif
extern void __declspec(naked)
extern void __declspec(naked) __cdecl
_EH_epilog3_GS_align(
void
)
Expand Down
16 changes: 16 additions & 0 deletions src/crt/i386/exsup.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
page ,132
title exsup.asm
;***
;exsup.asm
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;Purpose:
; Exception handling for i386.
;
;*******************************************************************************

.686
.model flat

END
16 changes: 16 additions & 0 deletions src/crt/i386/exsup2.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
page ,132
title exsup2.asm
;***
;exsup2.asm
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;Purpose:
; Exception handling for i386.
;
;*******************************************************************************

.686
.model flat

END
16 changes: 16 additions & 0 deletions src/crt/i386/exsup3.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
page ,132
title exsup3.asm
;***
;exsup3.asm
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;Purpose:
; Exception handling for i386.
;
;*******************************************************************************

.686
.model flat

END
48 changes: 48 additions & 0 deletions src/crt/i386/exsup4.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
page ,132
title exsup4.asm
;***
;exsup4.asm - defines _EH4_GlobalUnwind2
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;Purpose:
; Exception handling for i386.
;
;*******************************************************************************

.686
.model flat

extrn __imp__RtlUnwind@16:dword

.code

ALIAS <@_EH4_GlobalUnwind2@8> = <_EH4_GlobalUnwind2>

;void __fastcall
;_EH4_GlobalUnwind2(
; _In_opt_ PEXCEPTION_REGISTRATION_RECORD EstablisherFrame,
; _In_opt_ PEXCEPTION_RECORD ExceptionRecord
; );

_EH4_GlobalUnwind2 PROC
push ebp
mov ebp, esp
push ebx
push esi
push edi
push 0 ; ReturnValue
push edx ; ExceptionRecord
push offset ReturnPoint ; TargetIp
push ecx ; TargetFrame
call __imp__RtlUnwind@16

ReturnPoint:
pop edi
pop esi
pop ebx
pop ebp
retn
_EH4_GlobalUnwind2 ENDP

END
4 changes: 2 additions & 2 deletions src/crt/vcruntime/riscchandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Module Name:

#ifndef DISABLE_NLG

extern "C" VOID
extern "C" VOID _cdecl
_NLG_Notify (
IN PVOID uoffDestination,
IN PVOID uoffFramePointer,
IN ULONG dwCode
);

extern "C" VOID
extern "C" VOID _cdecl
__NLG_Return2 (
VOID
);
Expand Down

0 comments on commit 5a877f6

Please sign in to comment.