Adapting debugging code