Index: kernel/generic/src/interrupt/interrupt.c
===================================================================
--- kernel/generic/src/interrupt/interrupt.c	(revision 32e6c9c63d4fb7060344d129538b1356d34ea9dd)
+++ kernel/generic/src/interrupt/interrupt.c	(revision 3ff2b5474db5d13ba2132c533593a7bcdbf4126a)
@@ -87,6 +87,15 @@
 {
 	ASSERT(n < IVT_ITEMS);
+
+#ifdef CONFIG_UDEBUG
+	if (THREAD) THREAD->udebug.uspace_state = istate;
+#endif
 	
 	exc_table[n].f(n + IVT_FIRST, istate);
+
+#ifdef CONFIG_UDEBUG
+	if (THREAD) THREAD->udebug.uspace_state = NULL;
+#endif
+
 	/* This is a safe place to exit exiting thread */
 	if (THREAD && THREAD->interrupted && istate_from_uspace(istate))
Index: kernel/generic/src/time/clock.c
===================================================================
--- kernel/generic/src/time/clock.c	(revision 32e6c9c63d4fb7060344d129538b1356d34ea9dd)
+++ kernel/generic/src/time/clock.c	(revision 3ff2b5474db5d13ba2132c533593a7bcdbf4126a)
@@ -191,4 +191,12 @@
 		if (!ticks && !PREEMPTION_DISABLED) {
 			scheduler();
+#ifdef CONFIG_UDEBUG
+			/*
+			 * Give udebug chance to stop the thread
+			 * before it begins executing.
+			 */
+			if (istate_from_uspace(THREAD->udebug.uspace_state))
+				udebug_before_thread_runs();
+#endif
 		}
 	}
Index: kernel/generic/src/udebug/udebug.c
===================================================================
--- kernel/generic/src/udebug/udebug.c	(revision 32e6c9c63d4fb7060344d129538b1356d34ea9dd)
+++ kernel/generic/src/udebug/udebug.c	(revision 3ff2b5474db5d13ba2132c533593a7bcdbf4126a)
@@ -70,4 +70,5 @@
 
 	ut->go_call = NULL;
+	ut->uspace_state = NULL;
 	ut->go = false;
 	ut->stoppable = true;
@@ -232,24 +233,11 @@
 /** Upon being scheduled to run, check if the current thread should stop.
  *
- * This function is called from clock(). Preemption is enabled.
- * interrupts are disabled, but since this is called after
- * being scheduled-in, we can enable them, if we're careful enough
- * not to allow arbitrary recursion or deadlock with the thread context.
+ * This function is called from clock().
  */
 void udebug_before_thread_runs(void)
 {
-	ipl_t ipl;
-
-	return;
-
-	ipl = interrupts_enable();
-
-	/* Now we're free to do whatever we need (lock mutexes, sleep, etc.) */
-
 	/* Check if we're supposed to stop */
 	udebug_stoppable_begin();
 	udebug_stoppable_end();
-
-	interrupts_restore(ipl);
 }
 
