Update contrib.
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\euser\epoc\win32\uc_trp.cpp
22 GLREF_C void Panic(TCdtPanic);
24 #ifndef __LEAVE_EQUALS_THROW__
26 // __thiscall - parameter is expected to be removed by this function
27 EXPORT_C TInt TTrap::Trap(TInt &aResult)
29 // Save the enter frame state and return 0.
32 // compiler generates push ebp; mov ebp,esp here
33 // hence correct action for Leave() is to restore ebp then mov esp,ebp; pop ebp; ret 4
40 _asm mov [eax+12], ebp
46 _asm mov [eax+32], edx
48 _asm mov [eax+36], edx
49 TTrapHandler* h = Exec::PushTrapFrame(this);
57 // __cdecl - this function will leave parameter on the stack
58 // but it will return to the instruction after the call to TTrap::Trap()
59 // and this expects a parameter to be popped from the stack
60 // so we must return with a ret 4, rather than leaving the compiler to generate a ret 0
61 EXPORT_C void User::Leave(TInt aReason)
63 Leaves the currently executing function, unwinds the call stack, and returns
64 from the most recently entered trap harness.
66 @param aReason The value returned from the most recent call to TRAP or TRAPD.
67 This is known as the reason code and, typically, it gives the
68 reason for the environment or user error causing this leave
76 TTrap *pT=Exec::PopTrapFrame();
78 ::Panic(EUserLeaveWithoutTrap);
79 TTrapHandler *pH=pT->iHandler;
84 _asm mov ebp, [eax+12]
93 _asm mov edx, [eax+32]
95 _asm mov edx, [eax+36]
104 #else // !__LEAVE_EQUALS_THROW__