Adapt DebugMode for context support.