equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * function the runtime can call to 'raise an exception' |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <e32std.h> |
|
21 #include <e32std_private.h> |
|
22 #include <signal.h> // get from %ARMINC% |
|
23 |
|
24 extern "C" { |
|
25 |
|
26 EXPORT_C TInt __rt_raise(TInt signal, TInt type) |
|
27 { |
|
28 TExcType aExc = EExcGeneral; |
|
29 // translate signal into EPOC exception |
|
30 switch (signal) |
|
31 { |
|
32 case SIGABRT : |
|
33 aExc = EExcAbort; |
|
34 break; |
|
35 case SIGFPE : |
|
36 switch (type) |
|
37 { |
|
38 case DIVBYZERO : |
|
39 aExc = EExcAbort; |
|
40 break; |
|
41 default: |
|
42 aExc = EExcFloatInvalidOperation; |
|
43 } |
|
44 break; |
|
45 case SIGILL : |
|
46 aExc = EExcCodeAbort; |
|
47 break; |
|
48 case SIGINT : |
|
49 aExc = EExcUserInterrupt; |
|
50 break; |
|
51 case SIGSEGV : |
|
52 aExc = EExcDataAbort; |
|
53 break; |
|
54 case SIGTERM : |
|
55 aExc = EExcKill; |
|
56 break; |
|
57 } |
|
58 // yuk. Introduces dependendcy on EUSER!! |
|
59 User::RaiseException(aExc); |
|
60 return signal; |
|
61 } |
|
62 } |
|
63 |