Debug event loop code. Debug helpers functions.