Index: libcfa/src/bits/debug.hfa
===================================================================
--- libcfa/src/bits/debug.hfa	(revision 93ace835b9fd10f88a6a2a4557c96120d0eeb6a9)
+++ libcfa/src/bits/debug.hfa	(revision c7978c0d3d2a459859659a62d13584611c72d4ee)
@@ -9,7 +9,7 @@
 // Author           : Thierry Delisle
 // Created On       : Mon Nov 28 12:27:26 2016
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Feb  4 12:29:21 2020
-// Update Count     : 9
+// Last Modified By : Andrew Beach
+// Last Modified On : Mon Apr 27 10:15:00 2020
+// Update Count     : 10
 //
 
@@ -40,5 +40,4 @@
 #endif
 	#include <stdarg.h>
-	#include <stdio.h>
 
 	extern void __cfaabi_bits_write( int fd, const char buffer[], int len );
@@ -49,8 +48,16 @@
 	extern void __cfaabi_bits_print_vararg( int fd, const char fmt[], va_list arg );
 	extern void __cfaabi_bits_print_buffer( int fd, char buffer[], int buffer_size, const char fmt[], ... ) __attribute__(( format(printf, 4, 5) ));
+
+#if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_IO__) \
+		|| defined(__CFA_DEBUG_PRINT_MONITOR__) || defined(__CFA_DEBUG_PRINT_PREEMPTION__) \
+		|| defined(__CFA_DEBUG_PRINT_RUNTIME_CORE__) || defined(__CFA_DEBUG_PRINT_EXCEPTION__)
+	#include <stdio.h>
+	#include <unistd.h>
+#endif
 #ifdef __cforall
 }
 #endif
 
+// Deprecated: Use the versions with the new module names.
 #ifdef __CFA_DEBUG_PRINT__
 	#define __cfaabi_dbg_write( buffer, len )         __cfaabi_bits_write( STDERR_FILENO, buffer, len )
@@ -73,4 +80,57 @@
 #endif
 
+// Debug print functions and statements:
+// Most are wrappers around the bits printing function but are not always used.
+// If they are used depends if the group (first argument) is active or not. The group must be one
+// defined belowe. The other arguments depend on the wrapped function.
+#define __cfadbg_write(group, buffer, len) \
+	__CFADBG_PRINT_GROUP_##group(__cfaabi_bits_write(STDERR_FILENO, buffer, len))
+#define __cfadbg_acquire(group) \
+	__CFADBG_PRINT_GROUP_##group(__cfaabi_bits_acquire())
+#define __cfadbg_release(group) \
+	__CFADBG_PRINT_GROUP_##group(__cfaabi_bits_release())
+#define __cfadbg_print_safe(group, ...) \
+	__CFADBG_PRINT_GROUP_##group(__cfaabi_bits_print_safe(STDERR_FILENO, __VA_ARGS__))
+#define __cfadbg_print_nolock(group, ...) \
+	__CFADBG_PRINT_GROUP_##group(__cfaabi_bits_print_nolock(STDERR_FILENO, __VA_ARGS__))
+#define __cfadbg_print_buffer(group, ...) \
+	__CFADBG_PRINT_GROUP_##group(__cfaabi_bits_print_buffer(STDERR_FILENO, __VA_ARGS__))
+#define __cfadbg_print_buffer_decl(group, ...) \
+	__CFADBG_PRINT_GROUP_##group(char __dbg_text[256]; int __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __cfaabi_bits_write( __dbg_text, __dbg_len ))
+#define __cfadbg_print_buffer_local(group, ...) \
+	__CFADBG_PRINT_GROUP_##group(__dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __cfaabi_bits_write(STDERR_FILENO, __dbg_text, __dbg_len))
+
+// The debug print groups:
+#if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_IO__)
+#	define __CFADBG_PRINT_GROUP_io(...) __VA_ARGS__
+#else
+#	define __CFADBG_PRINT_GROUP_io(...) ((void)0)
+#endif
+#if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_MONITOR__)
+#	define __CFADBG_PRINT_GROUP_monitor(...) __VA_ARGS__
+#else
+#	define __CFADBG_PRINT_GROUP_monitor(...) ((void)0)
+#endif
+#if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_PREEMPTION__)
+#	define __CFADBG_PRINT_GROUP_preemption(...) __VA_ARGS__
+#else
+#	define __CFADBG_PRINT_GROUP_preemption(...) ((void)0)
+#endif
+#if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_RUNTIME_CORE__)
+#	define __CFADBG_PRINT_GROUP_runtime_core(...) __VA_ARGS__
+#else
+#	define __CFADBG_PRINT_GROUP_runtime_core(...) ((void)0)
+#endif
+#if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_READY_QUEUE__)
+#	define __CFADBG_PRINT_GROUP_ready_queue(...) __VA_ARGS__
+#else
+#	define __CFADBG_PRINT_GROUP_ready_queue(...) ((void)0)
+#endif
+#if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_EXCEPTION__)
+#	define __CFADBG_PRINT_GROUP_exception(...) __VA_ARGS__
+#else
+#	define __CFADBG_PRINT_GROUP_exception(...) ((void)0)
+#endif
+
 // Local Variables: //
 // mode: c //
