The present application generally relates to computer systems, programming and error identification, and more particularly to selective automated expansion of structured data at debug time.
Many common data structures comprise complex organization of data instances interconnected via reference (pointers). To help visualize these structures at debug time, software debuggers often create hierarchical or graph-based presentations to make the organization of these references explicit. When presented in the debugger, references to data structures may be expanded or collapsed. As with many computer-based tools, one key to productivity is effectively managing the amount and nature of the detail presented to focus directly on the task at hand. Thus, for some debugging tasks, the programmer may want certain references to be expanded automatically, whereas other parts should be left collapsed. For example, to quickly inspect the contents of a linked list, having the “next” field reference be automatically expanded can be very effective. The present disclosure provides a mechanism for specifying such automated debug-time behavior by the programmer.
A method and system for selective automated expansion of structured data at debug time are provided. The method, in one aspect, may include enabling of specifying of one or more expansion rules for selecting one or more fields in a structured data to be expanded and presented during debug procedure. The method may also include applying the one or more expansion rules to data structure of a program execution environment. The method may further include automatically expanding one or more selected fields according to the one or more expansion rules, and presenting the expanded one or more selected fields and associated data values at debug time.
A system for selective automated expansion of structured data at debug time, in one aspect, may include a user interface module operable to enable user to specify of one or more expansion rules for selecting one or more fields in a structured data to be expanded and presented during debug procedure. A debug module may be operable to apply the one or more expansion rules to structured data of a program execution environment and identify one or more fields meeting one or more criteria specified in the one or more expansion rules.
A computer readable storage medium storing a program of instructions executable by a machine to perform one or more methods described herein also may be provided.
Further features as well as the structure and operation of various embodiments are described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers indicate identical or functionally similar elements.
A set of expansion rules or filters are provided that instruct the debugger when to expand references contained within structured data types on a type-by-type basis.
For instance, the rules or filters may be maintained by the debugger for the application being debugged. The debugger herein refers to an application, a module or a tool or the like that can be used for identifying errors in a program. The debugger may be a part of a programming environment, for instance, an integrated development environment. The expansion rules and filters may augment an existing debugger, and may be used as follows:
The debugger provides a user interface for specifying such rules.
The programmer specifies any desired rules through this user interface.
The debugger applies these rules to determine which references to expand automatically when presenting program data, for example, at a breakpoint, or during a post-mortem inspection of program data.
In one aspect, each structure data type may be associated at most with one type expansion rule. A type expansion rule is a list of field expansion rules for fields that are of a reference type, at most one per field. The presentation of a field is automatically expanded by the debugger at run time if so specified by the corresponding field expansion rule.
A field expansion rule is a pair of a field name (unique within the owning type) and, optionally, a predicate (i.e., a Boolean expression) that indicates when to automatically expand that field. The default value of this expression (when omitted) is “true”, which means to expand unconditionally (as long as the value is expandable). A predicate expression may be other than a Boolean expression.
The programmer or the like may specify a simple expression, such as “true” or “false”, or a more complex one that takes into account values of program variables. This implies that at different points in a program's execution, a given instance of a given data type may be displayed with a different subset of its fields expanded. A predicate expression may only reference data accessible from an object instance of the type associated with the type expansion rule. Specifically, though, predicate expressions may reference other fields in the data type associated with the type expansion rule, as well as data indirectly accessible via such fields, or via globally-accessible data. Globally-accessible data refer to data that are applicable to multiple programs that, e.g., share a common set of data types.
As a simple example, for a structured type “T” containing reference fields “p1” and “p2” and Boolean field “flag”, the expression “! flag” is a valid predicate for a field expansion rule for field “p1” and/or “p2”.
Another example is illustrated in
The result of applying rule “e1” on a sample instance is shown at 124.
In the case that no predicate is present in a given expansion rule specification, the corresponding field is always automatically expanded whenever an instance of the given type of data is displayed. Conversely, any field of a type that is not specified in the expansion rule for the type would not be expanded for display by the debugger.
If, on the other hand, a given field specification contains a predicate, if that predicate evaluates to true, the field would be automatically expanded for display. This means that at different points in a program's execution, a given instance of a given data type may be displayed with a different subset of its fields being expanded.
In one aspect, a predicate expression may only reference data accessible from an object instance of the type associated with the expansion rule. Specifically, though, predicate expressions may reference other fields in the given data type, as well as data indirectly accessible via such reference fields, or via globally-accessible data.
The result of applying the expansion rule “e1” 102 to type “A” 102 is shown at 124. In this example, the fields of the type which are themselves of a scalar type (i.e., have no structure of their own) are not expandable and are displayed as default. Thus, the “isMgr” field which has a Boolean value is presented at 126. The “mgr” field 127 is automatically expanded and the data values of the expanded “mgr” field 128 are presented. The “salary” field 130 nested within the “mgr” field 128 is not automatically expanded since no specification is given for it to be automatically expanded in the expansion rule “e1” 102. Should this field be desired to be expanded, a specification such as “Field: mgr.salary” may be included in the expansion rule.
The “salary” field is shown as automatically expanded because it was specified in the expansion rule “e1” 102 at 112 and meets the threshold or criteria specified at 114. That is, “isMgr” field 126 is false and the salary amount is less than 5000.
A user interface module 202 presents to the user an interface, for instance, a display screen form for allowing the user to enter the desired expansion rule, i.e., the types of data structure by unique identification and the fields of that data structure the user desires to see automatically expanded during the debug procedure or process, and any conditions under which the user desires to see those fields expanded and the values of the expanded fields. The input form may have an enterable input fields, a list of menu items from which to select, or others. Other input mechanisms other than a display form may be utilized, for example, voice activated input and/or others. As explained above, the conditions for automatic expansion may be specified by a predicate specification in the type expansion rule. During the debug time, a debug module 206 applies the expansion rule specified by the user to the data structure of the program being debugged 208. At the predetermined or specified points of execution in the program, the data structure, data field values, and those data field values in which a condition was specified and those that satisfy the condition are expanded and presented to the user, for example, via the user interface module 202. The debugger module 206 and the user interface module 202 may be implemented as part of an integrated program development environment, which for example, enable users to program, execute, test and debug programs. The points in the execution for presenting the expanded values may be breakpoints specified by the user in debugging the program.
It should be understood that while
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon.
Any combination of one or more computer readable medium(s) may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
Aspects of the present invention are described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Referring now to
The computer program product may comprise all the respective features enabling the implementation of the methodology described herein, and which—when loaded in a computer system—is able to carry out the methods. Computer program, software program, program, or software, in the present context means any expression, in any language, code or notation, of a set of instructions intended to cause a system having an information processing capability to perform a particular function either directly or after either or both of the following: (a) conversion to another language, code or notation; and/or (b) reproduction in a different material form.
The computer processing system that carries out the system and method of the present disclosure may also include a display device such as a monitor or display screen 4 for presenting output displays and providing a display through which the user may input data and interact with the processing system, for instance, in cooperation with input devices such as the keyboard 6 and mouse device 8 or pointing device. The computer processing system may be also connected or coupled to one or more peripheral devices such as the printer 10, scanner (not shown), speaker, and any other devices, directly or via remote connections. The computer processing system may be connected or coupled to one or more other processing systems such as a server 10, other remote computer processing system 14, network storage devices 12, via any one or more of a local Ethernet, WAN connection, Internet, etc. or via any other networking methodologies that connect different computing systems and allow them to communicate with one another. The various functionalities and modules of the systems and methods of the present disclosure may be implemented or carried out distributedly on different processing systems (e.g., 2, 14, 16), or on any single platform, for instance, accessing data stored locally or distributedly on the network.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The corresponding structures, materials, acts, and equivalents of all means or step plus function elements, if any, in the claims below are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the invention. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
Various aspects of the present disclosure may be embodied as a program, software, or computer instructions embodied in a computer or machine usable or readable medium, which causes the computer or machine to perform the steps of the method when executed on the computer, processor, and/or machine. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform various functionalities and methods described in the present disclosure is also provided.
The system and method of the present disclosure may be implemented and run on a general-purpose computer or special-purpose computer system. The computer system may be any type of known or will be known systems and may typically include a processor, memory device, a storage device, input/output devices, internal buses, and/or a communications interface for communicating with other computer systems in conjunction with communication hardware and software, etc.
The terms “computer system” and “computer network” as may be used in the present application may include a variety of combinations of fixed and/or portable computer hardware, software, peripherals, and storage devices. The computer system may include a plurality of individual components that are networked or otherwise linked to perform collaboratively, or may include one or more stand-alone components. The hardware and software components of the computer system of the present application may include and may be included within fixed and portable devices such as desktop, laptop, server. A module may be a component of a device, software, program, or system that implements some “functionality”, which can be embodied as software, hardware, firmware, electronic circuitry, or etc.
The embodiments described above are illustrative examples and it should not be construed that the present invention is limited to these particular embodiments. Thus, various changes and modifications may be effected by one skilled in the art without departing from the spirit or scope of the invention as defined in the appended claims.
This application is related to U.S. patent application Ser. No. ______ (Attorney docket YOR920090616US1 (24823)), entitled FILTERED PRESENTATION OF STRUCTURED DATA AT DEBUG TIME, filed on Feb. 22, 2010, which is incorporated by reference herein in its entirety.