debug/exception mechanism