Implement get_stop_reason and add a helper for debugging targets that get into a bad state

Getting closer to the problem with continue-after-breakpoint; it looks like for some reason the breakpoint instruction isn't being repaired properly.