VM: Add support for a debug function