Patent ID: 8196107

Claim:
At a computer system, the computer system including a debugger, the debugger configured to perform one or more debugging operations, including a stepping operation for stepping through compiled code, a method for configuring the computer system to adapt interpreted code into a format that is compatible with the stepping operation such that the debugger can step through the interpreted code, the method comprising: an act of an interpreter receiving an indication that it is to interpret source input data; an act of initiating a primary thread to interpret the source input data, the primary thread including a primary physical call stack for the interpreter, a virtual call stack for the source input data to be stored as data within the primary physical call stack, the virtual call stack changing as the interpreter executes; an act of the primary thread defining states in the source input data; an act of the primary thread initializing an auxiliary thread including an auxiliary physical call stack and a helper function, the helper function configured to: emit code portions corresponding to each defined state, the code portions in a format that is compatible with the stepping operation of the debugger; receive inter-thread communication from the primary thread indicative of entering and leaving defined states within the source input data during interpreting; manage the auxiliary physical call stack to represent the virtual call stack for the source input data to the debugger, including: pushing emitted code portions onto the auxiliary physical call stack in response to corresponding inter-thread communication indicative of entering a defined state in the source input data; popping emitted code portions from the auxiliary physical call stack in response to corresponding inter-thread communication indicative of leaving a defined state in the source input data; and distinguishing between helper function code and emitted code portions within the auxiliary physical call stack, thus permitting the auxiliary thread to provide the debugger with the emitted code portions such that the debugger can step through the emitted code portions to simulate stepping through the source input data.