debug_and_run function

Run a function in debug mode.