There are no interactive debugging tools in the IDE, so forget breakpoints, inspecting variables etc. You will need to add debugging code to tell you what is going on. There was a discussion on it in this thread: http://arduino.cc/forum/index.php/topic,90660.0.html although it did get a bit "four yorkshiremen" towards the end.