Index: kernel/generic/src/udebug/udebug.c
===================================================================
--- kernel/generic/src/udebug/udebug.c	(revision 55b77d9e6e4dab7c54e9826ca79d2d6a0ddb6d87)
+++ kernel/generic/src/udebug/udebug.c	(revision 38e52c92f3bfac1d2b27e99d723de774dd20d0e3)
@@ -410,8 +410,7 @@
 		
 		mutex_lock(&thread->udebug.lock);
-		unsigned int flags = thread->flags;
 		
 		/* Only process userspace threads. */
-		if ((flags & THREAD_FLAG_USPACE) != 0) {
+		if (thread->uspace) {
 			/* Prevent any further debug activity in thread. */
 			thread->udebug.active = false;
Index: kernel/generic/src/udebug/udebug_ops.c
===================================================================
--- kernel/generic/src/udebug/udebug_ops.c	(revision 55b77d9e6e4dab7c54e9826ca79d2d6a0ddb6d87)
+++ kernel/generic/src/udebug/udebug_ops.c	(revision 38e52c92f3bfac1d2b27e99d723de774dd20d0e3)
@@ -95,5 +95,5 @@
 	
 	/* Verify that 'thread' is a userspace thread. */
-	if ((thread->flags & THREAD_FLAG_USPACE) == 0) {
+	if (!thread->uspace) {
 		/* It's not, deny its existence */
 		irq_spinlock_unlock(&thread->lock, true);
@@ -200,5 +200,5 @@
 		
 		mutex_lock(&thread->udebug.lock);
-		if ((thread->flags & THREAD_FLAG_USPACE) != 0) {
+		if (thread->uspace) {
 			thread->udebug.active = true;
 			mutex_unlock(&thread->udebug.lock);
@@ -393,9 +393,9 @@
 		
 		irq_spinlock_lock(&thread->lock, false);
-		int flags = thread->flags;
+		bool uspace = thread->uspace;
 		irq_spinlock_unlock(&thread->lock, false);
 		
 		/* Not interested in kernel threads. */
-		if ((flags & THREAD_FLAG_USPACE) == 0)
+		if (!uspace)
 			continue;
 		
