- Timestamp:
- Nov 5, 2007, 3:25:55 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/system/exception.ab
r249 r372 3 3 Class TryLayer 4 4 Public 5 Const AddressOfCatch As VoidPtr 6 Const StackPtr As LONG_PTR 5 Const addressOfCatch As VoidPtr 6 Const basePtr As LONG_PTR 7 Const stackPtr As LONG_PTR 7 8 context As CONTEXT 8 9 Const debugProcNum As DWord 9 10 10 Sub TryLayer( AddressOfCatch As VoidPtr, StackPtr As LONG_PTR ) 11 This.AddressOfCatch = AddressOfCatch 12 This.StackPtr = StackPtr 11 Sub TryLayer( addressOfCatch As VoidPtr, basePtr As LONG_PTR, stackPtr As LONG_PTR ) 12 This.addressOfCatch = addressOfCatch 13 This.basePtr = basePtr 14 This.stackPtr = stackPtr 13 15 14 context.ContextFlags=CONTEXT_ALL 15 If Thread.CurrentThread().__GetContext(context) = 0 Then 16 Dim tempContext As CONTEXT 17 18 tempContext.ContextFlags = CONTEXT_CONTROL or CONTEXT_INTEGER 19 If Thread.CurrentThread().__GetContext(tempContext) = 0 Then 16 20 ' TODO: エラー処理 17 21 debug 18 22 End If 23 context = tempContext 19 24 20 25 #ifdef _DEBUG … … 53 58 54 59 'Try 55 Function BeginTryScope( AddressOfCatch As VoidPtr, StackPtr As LONG_PTR ) As TryLayer60 Function BeginTryScope( addressOfCatch As VoidPtr, basePtr As LONG_PTR, stackPtr As LONG_PTR ) As TryLayer 56 61 ppTryLayers = _System_realloc( ppTryLayers, ( nTryLayers + 1 ) * SizeOf( *TryLayer ) ) 57 ppTryLayers[nTryLayers] = New TryLayer( AddressOfCatch, StackPtr )62 ppTryLayers[nTryLayers] = New TryLayer( addressOfCatch, basePtr, stackPtr ) 58 63 nTryLayers++ 59 64 … … 87 92 '-------------------------------------------------- 88 93 94 'レジスタ情報を取得 95 Dim context = ppTryLayers[nTryLayers - 1]->context 96 89 97 'カレント スレッドを取得 90 98 Dim thread = Thread.CurrentThread 91 99 92 'レジスタ情報を取得93 Dim context = ppTryLayers[nTryLayers - 1]->context94 debug95 100 '新しいip, spをセット 96 101 #ifdef _WIN64 97 context.Rip = ppTryLayers[nTryLayers - 1]->AddressOfCatch As QWord 98 'context.Rsp = ppTryLayers[nTryLayers - 1]->StackPtr 102 context.Rip = ppTryLayers[nTryLayers - 1]->addressOfCatch As QWord 103 context.Rbp = ppTryLayers[nTryLayers - 1]->basePtr 104 context.Rsp = ppTryLayers[nTryLayers - 1]->stackPtr 99 105 #else 100 context.Eip = ppTryLayers[nTryLayers - 1]->AddressOfCatch As DWord 101 context.Esp = ppTryLayers[nTryLayers - 1]->StackPtr 106 context.Eip = ppTryLayers[nTryLayers - 1]->addressOfCatch As DWord 107 context.Ebp = ppTryLayers[nTryLayers - 1]->basePtr 108 context.Esp = ppTryLayers[nTryLayers - 1]->stackPtr 102 109 #endif 103 110 … … 109 116 End If 110 117 #endif 111 118 debug 112 119 If thread.__SetContext( context ) = 0 Then 113 120 OutputDebugString(Ex"レジスタ情報の設定に失敗しました。\r\n") 114 121 Return 115 122 End If 123 debug 116 124 End Sub 117 125
Note:
See TracChangeset
for help on using the changeset viewer.