Patent ID: 8572578

Claim:
A method for debugging a script that includes a call to non-script code, the method comprising: an act of executing a debugger process and a user process at a computer system including one or more processors and system memory, the debugger process including a normal input module, a break mode input module, and debugger engine capable of debugging both script and non-script code, the user process including a listener, an alternative listener, a first code portion, and a second code portion, wherein the normal input module, the listener, and the first code portion are configured to interoperate to provide a read-evaluate-print-loop in a normal input state, and the break mode input module, the alternative listener, and the second code portion are configured to interoperate to provide a simulated read-evaluate-print-loop in a nested break state; an act of using the read-evaluate-print-loop in the normal input state to compile and debug the script, including one or more read-evaluate-print iterations of: an act of the normal input module of the debugger process receiving some representation of user code for the script; an act of the normal input module sending the representation of the user code to the listener in the user process, the listener being configured to dispatch the representation of the user code to an evaluator thread to execute the user code; and an act of the normal input module receiving results of executing the user code from the evaluator thread; an act of encountering a breakpoint in the user code for a specified read-evaluate-print iteration, the breakpoint causing the listener to pause operation; an act of determining that the user code can be safely hijacked from the breakpoint to continue executing the user code; if the user code is safely hijacked: an act of transitioning to the nested break state; an act of simulating the read-evaluate-print-loop in the nested break state to continue to compile and debug the script when the listener is paused, including: an act of the break mode input module of the debugger process receiving some representation of user code for the script; an act of the break mode input module sending the representation of the user code to the alternate listener in the user process, the alternate listener for dispatching the representation of the user code to the evaluator thread to execute the user code; and an act of the break mode input module receiving results of executing the user code from the evaluator thread; an act of detecting that execution of the user code has subsequently continued from the encountered breakpoint, the continuation causing the listener to resume operation; and an act of resuming use of the read-evaluate-print-loop in response to the listener resuming operation.