Adhesion and debonding in a model of elastic string