Patent ID: 8527961

Claim:
A machine-implemented method for debugging a program, the method comprising: establishing a first breakpoint at a first program location that is in a particular line of source code; establishing a second breakpoint at a second program location that is in the same particular line of the source code but at a different program location than the first program location; generating compiled byte code from the source code, wherein generating the compiled byte code comprises creating a line number table mapping byte code locations to line numbers of the source code; executing, using the compiled byte code, a thread until the first breakpoint is encountered, and responsively suspending execution of the thread until user input is received, wherein executing the thread and responsively suspending execution comprises: suspending execution of the thread on the particular line of the source code using the line number table; obtaining a list of expressions that start on the particular line of the source code; generating a list of abstract source tree (AST) nodes that correspond to expressions in the list of expressions; for each particular AST node in the list of AST nodes, binding the particular AST node to a byte code instruction that matches the particular AST node, wherein the list of AST nodes is ordered according to an order of byte code instructions in a byte code segment corresponding to the particular line of source code; for each particular AST node in the list of AST nodes, generating a corresponding set of other AST nodes that can follow the particular AST node in execution order; for each particular set of other AST nodes generated, and for each particular following AST node in the particular set of other AST nodes, binding the particular following AST node to a byte code instruction that matches the particular following AST node; selecting, from among the AST nodes in the list of AST nodes, a selected AST node that is bound to a greatest byte code location index that is also either less than or equal to the location to which the program counter refers; and for each following AST node in a set of following AST nodes that can follow the selected AST node in execution order, establishing a breakpoint at a byte code location that corresponds to that following AST node, wherein establishing a breakpoint at a byte code location that corresponds to that following AST node comprises establishing the first breakpoint; and in response to receiving user input, continuing to execute the thread until the second breakpoint is encountered, and responsively suspending execution of the thread.