Add a debug function.