Changeset 70ac8d0 for libcfa/src
- Timestamp:
- May 12, 2020, 4:55:42 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 068a202, f2d05e9
- Parents:
- 5c581cc (diff), 730f4f1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- libcfa/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/Makefile.in
r5c581cc r70ac8d0 307 307 DEFS = @DEFS@ 308 308 DEPDIR = @DEPDIR@ 309 DIST_BWLIMIT = @DIST_BWLIMIT@ 309 310 DLLTOOL = @DLLTOOL@ 310 311 DRIVER_DIR = @DRIVER_DIR@ -
libcfa/src/concurrency/kernel.cfa
r5c581cc r70ac8d0 374 374 375 375 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 376 /* paranoid */ verify( kernelTLS.this_thread == thrd_dst ); 376 377 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) < ((uintptr_t)__get_stack(thrd_dst->curr_cor)->base ) || thrd_dst->curr_cor == proc_cor, "ERROR : Destination $thread %p has been corrupted.\n StackPointer too small.\n", thrd_dst ); // add escape condition if we are setting up the processor 377 378 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) > ((uintptr_t)__get_stack(thrd_dst->curr_cor)->limit) || thrd_dst->curr_cor == proc_cor, "ERROR : Destination $thread %p has been corrupted.\n StackPointer too large.\n", thrd_dst ); // add escape condition if we are setting up the processor … … 384 385 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) > ((uintptr_t)__get_stack(thrd_dst->curr_cor)->limit), "ERROR : Destination $thread %p has been corrupted.\n StackPointer too large.\n", thrd_dst ); 385 386 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) < ((uintptr_t)__get_stack(thrd_dst->curr_cor)->base ), "ERROR : Destination $thread %p has been corrupted.\n StackPointer too small.\n", thrd_dst ); 387 /* paranoid */ verify( kernelTLS.this_thread == thrd_dst ); 386 388 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 387 389 -
libcfa/src/exception.c
r5c581cc r70ac8d0 121 121 122 122 123 // TERMINATION =============================================================== 124 125 // MEMORY MANAGEMENT (still for integers) 126 // May have to move to cfa for constructors and destructors (references). 123 // MEMORY MANAGEMENT ========================================================= 127 124 128 125 // How to clean up an exception in various situations. … … 203 200 } 204 201 205 // If this isn't a rethrow (*except==0), delete the provided exception. 206 void __cfaehm_cleanup_terminate( void * except ) { 207 if ( *(void**)except ) __cfaehm_delete_exception( *(exception_t **)except ); 208 } 202 // CANCELLATION ============================================================== 209 203 210 204 // Function needed by force unwind … … 228 222 } 229 223 224 // Cancel the current stack, prefroming approprate clean-up and messaging. 225 static __attribute__((noreturn)) void __cfaehm_cancel_stack( 226 exception_t * exception ) { 227 // TODO: Detect current stack and pick a particular stop-function. 228 _Unwind_Reason_Code ret; 229 ret = _Unwind_ForcedUnwind( &this_exception_storage, _Stop_Fn, (void*)0x22 ); 230 printf("UNWIND ERROR %d after force unwind\n", ret); 231 abort(); 232 } 233 234 235 // TERMINATION =============================================================== 236 237 // If this isn't a rethrow (*except==0), delete the provided exception. 238 void __cfaehm_cleanup_terminate( void * except ) { 239 if ( *(void**)except ) __cfaehm_delete_exception( *(exception_t **)except ); 240 } 241 230 242 // The exception that is being thrown must already be stored. 231 243 static __attribute__((noreturn)) void __cfaehm_begin_unwind(void) { … … 245 257 // the whole stack. 246 258 259 // No handler found, go to the default operation. 260 // Currently this will always be a cancellation. 247 261 if ( ret == _URC_END_OF_STACK ) { 248 // No proper handler was found. This can be handled in many ways, C++ calls std::terminate. 249 // Here we force unwind the stack, basically raising a cancellation. 250 printf("Uncaught exception %p\n", &this_exception_storage); 251 252 ret = _Unwind_ForcedUnwind( &this_exception_storage, _Stop_Fn, (void*)0x22 ); 253 printf("UNWIND ERROR %d after force unwind\n", ret); 254 abort(); 262 __cfadbg_print_safe(exception, "Uncaught exception %p\n", &this_exception_storage); 263 264 __cfaehm_cancel_stack(this_exception_context()->current_exception); 255 265 } 256 266
Note:
See TracChangeset
for help on using the changeset viewer.