1. A method for program debugging, the method comprising: (a)setting a plurality of breakpoints corresponding to a plurality of events in an implementation under test; (b)executing the implementation under test for outputting a diagnosis code of a breakpoint; (c)resetting a parameter of the event corresponding to the diagnosis code; and (d)executing the event according to the reset parameter for making the event undergo an error handler.