exception_behavior_t behavior;
thread_state_flavor_t flavor;
- thread_state_t thread_state = NULL;
+ thread_state_data_t thread_state;
mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX;
for(i=0; i < GC_old_exc_ports.count; i++)
behavior = GC_old_exc_ports.behaviors[i];
flavor = GC_old_exc_ports.flavors[i];
- if(behavior != EXCEPTION_DEFAULT) {
+ if(behavior == EXCEPTION_STATE || behavior == EXCEPTION_STATE_IDENTITY) {
r = thread_get_state(thread, flavor, thread_state, &thread_state_count);
if(r != KERN_SUCCESS)
ABORT("thread_get_state failed in forward_exception");
}
switch(behavior) {
- case EXCEPTION_DEFAULT:
- r = exception_raise(port, thread, task, exception, data, data_count);
- break;
case EXCEPTION_STATE:
r = exception_raise_state(port, thread, task, exception, data, data_count,
&flavor, thread_state, thread_state_count,
thread_state_count, thread_state,
&thread_state_count);
break;
- default:
- r = KERN_FAILURE; /* make gcc happy */
- ABORT("forward_exception: unknown behavior");
- break;
+ /* case EXCEPTION_DEFAULT: */ /* default signal handlers */
+ default: /* user-supplied signal handlers */
+ r = exception_raise(port, thread, task, exception, data, data_count);
}
- if(behavior != EXCEPTION_DEFAULT) {
+ if(behavior == EXCEPTION_STATE || behavior == EXCEPTION_STATE_IDENTITY) {
r = thread_set_state(thread, flavor, thread_state, thread_state_count);
if(r != KERN_SUCCESS)
ABORT("thread_set_state failed in forward_exception");