I've added a dbgflush() function to debug.c. Calling this will cause the