I have relatively good luck debugging Arduino sketches (well, libraries) by compiling on a unix system and poking at them with a standard debugger (gdb, etc) You have to create a phony framework of arduino core routines, and watch out for differences in the size of "int", but it is pretty helpful...