EP2011004B1

Method and system for providing a visual debugger for an interpreted statistical language

Abstract

This record has no abstract on file.

EP2011004B1, drawing sheet 1
Sheet 1 of 42

Term

0.5 yearsleft in the term

Expires 4 April 2027.

  1. Priority
  2. Filed
  3. Granted
  4. Today
  5. Expires

9 claims: 6 independent, 3 dependent

  1. 1
    A method in a computing system for debugging source code (1401) in a visual debugger using breakpoints to facilitate step-based evaluation of expressions, the source code being written in an interpreted programming language, the method comprising:presenting a visual user interface for receiving debugging commands;receiving a debug command to set or change an indicated breakpoint in a segment of the source code that is expressed in the interpreted programming language and that defines one or more expressions;in response to receiving the debug command to set or change the indicated breakpoint, determining the nearest enclosing expression to the indicated breakpoint, including determining the nearest enclosing expression that begins on a line of the source code associated with the segment that is different from a line of the associated source code that contains the indicated breakpoint, and generating a breakpoint address that indicates a location in the segment that corresponds to the beginning of the determined enclosing expression when the segment is evaluated, wherein the breakpoint address corresponds to a logical address in a parse tree wherein said parse tree includes references to source code and is generated by a secondary parser;causing the segment to be evaluated using an interpreter (1230) for the interpreted programming language, such that evaluation automatically stops when the location in the code segment that corresponds to the breakpoint address is encountered, wherein the interpreter for the interpreted programming language comprises a primary parser that generates a parse tree arranged according a grammar of the interpreted programming language, the parse tree generated by the primary parser containing no information regarding the corresponding source code or line numbers;causing one or more source code statements that correspond to and indicate the location in the segment where the evaluation stopped to be displayed in the visual user interface, wherein the parse tree generated by the secondary parser has the same structure as the parse tree generated by the primary parser, and wherein the generated breakpoint address that corresponds to the parse tree of the secondary parser is mapped to a memory address that corresponds to a node in the parse tree of the primary parser;and receiving one or more additional debug commands to further control the evaluation of the segment or to examine aspects of the segment under evaluation.
  2. 3
    The method of at least one of claims 1 or 2, further comprising receiving a second debug command that sets a second indicated breakpoint on the same line in the source code associated with the segment, such that a plurality of breakpoints are concurrently active for the segment.
  3. 4
    The method of at least one of the above claims wherein the visual user interface is an Interactive Development Environment, IDE, having a predefined set of interfaces for developing and testing program code.
  4. 5
    The method of claim 5 wherein the IDE uses Eclipse code and the visual user interface is implemented as a debug perspective plug-in that requires no launch configuration information to be forwarded to the IDE prior to debugging the source code.
  5. 6
    The method of at least one of the above claims wherein the interpreted programming language is S-PLUS.
  6. 7
    A computer-readable medium whose contents contain instructions that, when executed, cause a computing system to provide for debugging of source code (1401) written in an interpreted programming language in a visual debugger using breakpoints that facilitate step-based evaluation of expressions, by performing a method according to one of the above claims.
  7. 9
    A computing system for debugging source code (1401) programmed in an interpreted programming language defining a plurality of expressions, the computing system comprising:a visual user interface adapted to receive debugging commands, an interpreter (1230) for the interpreted programming language, wherein the interpreter comprises a primary parser adapted to generate a parse tree arranged according a grammar of the interpreted programming language, and a secondary parser;the computing system being adapted to: receive a debug command to set or change an indicated breakpoint in a segment of the source code that is expressed in the interpreted programming language and that defines one or more expressions;in response to receiving the debug command to set or change the indicated breakpoint, determine the nearest enclosing expression to the indicated breakpoint, including determining the nearest enclosing expression that begins on a line of the source code associated with the segment that is different from a line of the associated source code that contains the indicated breakpoint, and generate a breakpoint address that indicates a location in the segment that corresponds to the beginning of the determined enclosing expression when the segment is evaluated, wherein the breakpoint address corresponds a logical address in a parse tree wherein said parse tree includes references to source code and is generated by a secondary parser;cause the segment to be evaluated using the interpreter for the interpreted programming language, such that evaluation automatically stops when the location in the code segment that corresponds to the breakpoint address is encountered, the parse tree generated by the primary parser containing no information regarding the corresponding source code or line numbers;cause one or more source code statements that correspond to and indicate the location in the segment where the evaluation stopped to be displayed in the visual user interface, wherein the parse tree generated by the secondary parser has the same structure as the parse tree generated by the primary parser, and wherein the generated breakpoint address that corresponds to the parse tree of the secondary parser is mapped to a memory address that corresponds to a node in the parse tree of the primary parser;and receive one or more additional debug commands to further control the evaluation of the segment or to examine aspects of the segment under evaluation.