I have a Mathematica file called myUsefulFunctions.m containing, for example, a function called mySuperUsefulFunction. Suppose I call mySuperUsefulFunction in a notebook and get
You can use the WolframWorkbench and the debugger there:
http://www.wolfram.com/broadcast/screencasts/workbench/debugging/
you can then set a break point and step through the code.