Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/interrupt/interrupt.c

    r0d21b53 ra074b4f  
    134134        printf("\n");
    135135
    136         /*
    137          * Userspace can subscribe for FAULT events to take action
    138          * whenever a thread faults. (E.g. take a dump, run a debugger).
    139          * The notification is always available, but unless Udebug is enabled,
    140          * that's all you get.
    141          */
    142136        if (event_is_subscribed(EVENT_FAULT)) {
    143                 /* Notify the subscriber that a fault occurred. */
    144137                event_notify_3(EVENT_FAULT, LOWER32(TASK->taskid),
    145138                    UPPER32(TASK->taskid), (unative_t) THREAD);
     139        }
    146140
    147141#ifdef CONFIG_UDEBUG
    148                 /* Wait for a debugging session. */
    149                 udebug_thread_fault();
    150 #endif
    151         }
     142        /* Wait until a debugger attends to us. */
     143        mutex_lock(&THREAD->udebug.lock);
     144        while (!THREAD->udebug.active)
     145                condvar_wait(&THREAD->udebug.active_cv, &THREAD->udebug.lock);
     146        mutex_unlock(&THREAD->udebug.lock);
     147
     148        udebug_stoppable_begin();
     149        udebug_stoppable_end();
     150
     151        /* Make sure the debugging session is over before proceeding. */
     152        mutex_lock(&THREAD->udebug.lock);
     153        while (THREAD->udebug.active)
     154                condvar_wait(&THREAD->udebug.active_cv, &THREAD->udebug.lock);
     155        mutex_unlock(&THREAD->udebug.lock);
     156#endif
    152157
    153158        task_kill(task->taskid);
Note: See TracChangeset for help on using the changeset viewer.