Mercurial > projects > ldc
comparison tango/lib/compiler/llvmdc/eh.d @ 404:3ad8295cfac6
Mark most of the current EH implementation as x86 Linux specific.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 27 Jul 2008 13:51:55 +0200 |
parents | 5bea8a1ef905 |
children | dc7dff3ce72e |
comparison
equal
deleted
inserted
replaced
401:62715be72a06 | 404:3ad8295cfac6 |
---|---|
50 _Unwind_Exception_Cleanup_Fn exception_cleanup; | 50 _Unwind_Exception_Cleanup_Fn exception_cleanup; |
51 int private_1; | 51 int private_1; |
52 int private_2; | 52 int private_2; |
53 } | 53 } |
54 | 54 |
55 version(X86) { version(linux) { | |
55 void _Unwind_Resume(_Unwind_Exception*); | 56 void _Unwind_Resume(_Unwind_Exception*); |
56 _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception*); | 57 _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception*); |
57 ulong _Unwind_GetLanguageSpecificData(_Unwind_Context_Ptr context); | 58 ulong _Unwind_GetLanguageSpecificData(_Unwind_Context_Ptr context); |
58 ulong _Unwind_GetIP(_Unwind_Context_Ptr context); | 59 ulong _Unwind_GetIP(_Unwind_Context_Ptr context); |
59 ulong _Unwind_SetIP(_Unwind_Context_Ptr context, ulong new_value); | 60 ulong _Unwind_SetIP(_Unwind_Context_Ptr context, ulong new_value); |
60 ulong _Unwind_SetGR(_Unwind_Context_Ptr context, int index, ulong new_value); | 61 ulong _Unwind_SetGR(_Unwind_Context_Ptr context, int index, ulong new_value); |
61 ulong _Unwind_GetRegionStart(_Unwind_Context_Ptr context); | 62 ulong _Unwind_GetRegionStart(_Unwind_Context_Ptr context); |
63 } } | |
64 else | |
65 { | |
66 // runtime calls these directly | |
67 void _Unwind_Resume(_Unwind_Exception*) | |
68 { | |
69 console("_Unwind_Resume is not implemented on this platform.\n"); | |
70 } | |
71 _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception*) | |
72 { | |
73 console("_Unwind_RaiseException is not implemented on this platform.\n"); | |
74 return _Unwind_Reason_Code.FATAL_PHASE1_ERROR; | |
75 } | |
76 } | |
77 | |
62 } | 78 } |
63 | 79 |
64 | 80 |
65 // helpers for reading certain DWARF data | 81 // helpers for reading certain DWARF data |
66 //TODO: It may not be a good idea to use exceptions for error handling within exception handling code | 82 //TODO: It may not be a good idea to use exceptions for error handling within exception handling code |
124 | 140 |
125 // the 8-byte string identifying the type of exception | 141 // the 8-byte string identifying the type of exception |
126 // the first 4 are for vendor, the second 4 for language | 142 // the first 4 are for vendor, the second 4 for language |
127 //TODO: This may be the wrong way around | 143 //TODO: This may be the wrong way around |
128 char[8] _d_exception_class = "LLDCD1\0\0"; | 144 char[8] _d_exception_class = "LLDCD1\0\0"; |
145 | |
146 | |
147 // | |
148 // x86 Linux specific implementation of personality function | |
149 // and helpers | |
150 // | |
151 version(X86) version(linux) { | |
129 | 152 |
130 // the personality routine gets called by the unwind handler and is responsible for | 153 // the personality routine gets called by the unwind handler and is responsible for |
131 // reading the EH tables and deciding what to do | 154 // reading the EH tables and deciding what to do |
132 extern(C) _Unwind_Reason_Code _d_eh_personality(int ver, _Unwind_Action actions, ulong exception_class, _Unwind_Exception* exception_info, _Unwind_Context_Ptr context) | 155 extern(C) _Unwind_Reason_Code _d_eh_personality(int ver, _Unwind_Action actions, ulong exception_class, _Unwind_Exception* exception_info, _Unwind_Context_Ptr context) |
133 { | 156 { |
304 action = data + callsitelength; | 327 action = data + callsitelength; |
305 | 328 |
306 callsite = data; | 329 callsite = data; |
307 } | 330 } |
308 | 331 |
332 } // end of x86 Linux specific implementation | |
333 | |
334 | |
309 extern(C) void _d_throw_exception(Object e) | 335 extern(C) void _d_throw_exception(Object e) |
310 { | 336 { |
311 if (e !is null) | 337 if (e !is null) |
312 { | 338 { |
313 _d_exception* exc_struct = new _d_exception; | 339 _d_exception* exc_struct = new _d_exception; |