Setting instance breakpoints in object oriented computer...

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S152000

Reexamination Certificate

active

06240545

ABSTRACT:

BACKGROUND OF THE INVENTION
1. Technical Field
The present invention relates to techniques for debugging computer programs, particularly in the field of object oriented (OO) technology.
2. Prior Art
Debuggers are software tools that can be used to diagnose computer programs and trace errors that arise during execution of the program. To support the debugger, information describing symbols and types in the program as well as information to map between source lines and the binary code is required. In the case of compiled programs, the compiler, under the control of an option, can produce this information. This extra information, generally referred to as debugging information, enables the programmer to examine the types, variables and data structures by name and to follow the execution of the program through the source code.
A number of debugging techniques can be used to enable the programmer to properly analyze a program to detect points in the program where errors occur. One such technique is to put a breakpoint into the program, a point in the program where normal operation is suspended automatically when certain conditions are met. Breakpoints are useful for program testing. They are specified by programmers so that interim results of processing can be inspected, and then the program can be restarted to continue running normally.
In traditional debuggers, breakpoints are generally set on functions or methods; program execution is suspended each time the particular function is called. This technique is very useful for traditional procedural languages which are, themselves, function-based.
However, object oriented languages are based on quite a different concept. Programs are created using a set of language tools, abstractions and constructs that support a particular form of user-defined types called “classes”. Each such type associates the collection of declared data with a set of operations on that data, that is, methods are called on the data. Variables, or instances, of such types in the running programs are called objects.
A fundamental feature of object oriented programming is that classes can be related to one another by inheritance. The properties, behaviors, data and operations of a parent, or “base”, class may be inherited without modification by some child, or “derived”, class, or the behavior, properties and operations may be selectively refined under the control of the programmer in the derived class. The latter function is generally referred to as overriding. The function name remains the same, but the changed or overridden function operates on a different type. When defining a derived class, one may start by building on an existing base class which is similar to the one to be created. The derived class inherits the implementation and behavior of the base class, including its functions, except as modified by overriding amendments detailed in the derived class definition. Several classes can inherit the behaviors of a common parent, and a derived class may inherit from more than one base class.
Thus, in object oriented programs, each object defines an independent unit, and methods are called on the object. When an object becomes corrupted or otherwise mutates into a bad state, it can typically be assumed that this is caused by some method called on the object. The debugging issue, then, is to determine which method called on the object is causing the problem. Using a traditional debugger, an immense amount of superfluous information may be gathered, adding unnecessary complexity. This is because the methods that may be called for one object may also be called on any other object of the same class or type. (The construction of an object in memory is discussed in further detail below). In a normal program, thousands of instances of the class may be created in a running program. A breakpoint set on a method, then, will cause program execution to stop at each instance of the class by the method, both at the particular object being investigated and at all other instances in the class.
The continued emphasis in traditional debuggers on procedural debugging fails to take advantage of object oriented design.
SUMMARY OF THE INVENTION
It is therefore an object of the present invention to provide a debugger specifically designed to operate in an object oriented programming environment, and to take advantage of OO hierarchial structure to produce a minimal amount of debugging information appropriate to the conditions set for the debugging operation.
Accordingly, the present invention provides a program debugger for use in an object oriented programming environment that includes a persistent program representation containing the correspondence between virtual function tables and specific classes, and full class hierarchy information. The debugger has means for locating all methods applicable by a type. Preferably, these means include means for identifying all base classes for the type in the persistent program representation, such as by tracing the type in the persistent program representation through its virtual function table, and means for identifying all methods in the base classes and the type in the persistent program representation. The debugger also includes means for setting a breakpoint on the methods to suspend program execution when any of the methods is called by a first instance of the type, such as by comparing the values of the base class cast pointers with a pointer in the method when the method is called.
The invention also provides a method for setting an instance breakpoint in an object oriented program in a programming environment that includes a persistent program representation containing the correspondence between virtual function tables and specific classes, and full class hierarchy information. The method consists of locating all methods applicable by a type, and setting a breakpoint on the methods to suspend program execution when any of the methods is called by a first instance of the type. Preferably, the step of locating all methods consists of identifying all base classes for the type in the persistent program representation and identifying all methods in the base classes and the type in the persistent program representation. Preferably, the step of setting a breakpoint consists of evaluating a cast pointer for each of the base classes for the type and adding to each of the methods: 1) an expression to cause comparison of values of each cast pointer and a pointer in the method when the method is called, and 2) means to suspend program execution when the values are the same.


REFERENCES:
patent: 5093914 (1992-03-01), Coplien et al.
patent: 5560009 (1996-09-01), Lenkov et al.
patent: 5740440 (1998-04-01), West
patent: 5764989 (1998-06-01), Gustafsson et al.
patent: 5778230 (1998-07-01), Wimble et al.
patent: 5812850 (1998-09-01), Wimble
patent: 5845125 (1998-12-01), Nishimura et al.
patent: 5848274 (1998-12-01), Hamby et al.
patent: 5854931 (1998-12-01), Jones et al.
Aho et al.: Compilers: Principles, Techniques, and Tools. Reading, MA, Addison-Wesley Publishing Company, Chapter 10, pp 703-711, Sep. 1985.*
Rosenberg, J.; How Debuggers Work: Algorithms, Data Structures, and Architecture. Canada, John Wiley and Sons, Incorporated, Chapter 6, pp 107-133, Sep. 1996.*
Copperman, M.; “Debugging Optimized Code Without Being Misled”. ACM Digital Library[online], ACM Transactions on Programming Languages and Systems, vol. 16, Iss 3, pp. 387-427, May 1994.*
Wahl et al.; “A Dynamic Very High Level Debugger For Low Level Microprograms”. ACM Digital Library[online], Proceedings of the 19th Annual Workshop on Microprogramming, pp 148-155, Oct. 1986.*
Koch et al.; “Debugging of Behavioral VHDL Specifications by Source Level Emulation”. ACM Digital Library[online], Proceedings of European Design Automation Conference, pp 256-261, Sep. 1995.

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Setting instance breakpoints in object oriented computer... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Setting instance breakpoints in object oriented computer..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Setting instance breakpoints in object oriented computer... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2553700

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.