Index: kernel/generic/src/udebug/udebug.c
===================================================================
--- kernel/generic/src/udebug/udebug.c	(revision 96b02eb9b2f96f3843b8275c254c43a9cb6c8c88)
+++ kernel/generic/src/udebug/udebug.c	(revision efcebe1bce63b6779458eadc2fd6f252ab7cd703)
@@ -406,6 +406,5 @@
 	
 	/* Finish debugging of all userspace threads */
-	link_t *cur;
-	for (cur = task->th_head.next; cur != &task->th_head; cur = cur->next) {
+	list_foreach(task->threads, cur) {
 		thread_t *thread = list_get_instance(cur, thread_t, th_link);
 		
