For debugging, the are two possibilities:
1. If you are actually debugging, use a proper debugging tool (obviously) or, if you don't have one, add debugging code to your source (look in the manuals how to do this).
Simply adding DISPLAY statements and later removing them also works, of course...