Error detection/correction and fault detection/recovery – Data processing system error or fault handling – Reliability and availability
Reexamination Certificate
1996-02-23
2001-12-11
Le, Dieu Minh (Department: 2184)
Error detection/correction and fault detection/recovery
Data processing system error or fault handling
Reliability and availability
C714S038110
Reexamination Certificate
active
06330691
ABSTRACT:
BACKGROUND
The present invention concerns debugging programs and pertains particularly to the use of dynamic translation to provide breakpoints in non-writeable object code such as procedures within a shared library.
Programs are generally written in a high level programming language. This high level language, often referred to as source code, is translated by a compiler program into an assembly language. The binary form of the assembly language, called object code, is the form of the code actually executed by a computer. The object code is generally first produced in object code modules which are linked together by a linker For the purpose of the present application, the term “compile” includes both the process of producing the object code modules and linking the object code modules together.
Code debuggers are programs which aid a programmer in finding errors in code. They are extremely useful tools for improving the efficiency of the code debugging process. One of the important features of a code debugger is to allow a programmer to stop the execution of code and to check the values in each user resource the code is operating upon. A user resource is typically a variable defined in the source code. The values in the user resources give clues to indicate the source of trouble when a program is not operating correctly.
In order for a debugger to set a breakpoint at a particular address in an application, if the application is currently running, the application must be stopped. On computing systems which are operating under the UNIX operating system, this is typically done by sending the application a signal. Once the application is stopped, the debugger replaces the object code currently residing at the particular address with a special instruction which will cause execution to halt when it is reached. For example, for computing systems which are designed to execute a Precision Architecture Reduced Instruction Set Computer (PA-RISC) instruction set, a break instruction would typically be used to cause execution to halt. See “PA-RISC 1.1 Architecture and Instruction Set Reference Manual”, Third Edition, Hewlett-Packard Company Part Number 09740-90039, p. 5-138.
After the break instruction is placed in the object code, the application is allowed to resume execution. When and if execution of the application reaches the particular address, the break instruction is encountered and execution of the application is halted. Control is then given to the debugger. To remove the breakpoint at the particular address, the debugger replaces the break instruction with the instruction that was originally at the particular address.
The above described scheme for introducing break instructions into application programs has been complicated by recent developments in the architecture of application programs. Specifically, application programs are now often built out of layers of shared and reusable code which perform common tasks. For example, display window management code, database code and statistical analysis code typically reside in procedures which are shared by many applications. The procedures are typically packaged in units called shared libraries (SL) or demand-loaded libraries (DLL). Procedures within a shared library are typically shared by many application programs.
The use of shared libraries introduces a problem for a debugging program. Specifically, use of shared libraries makes it difficult to set break points in an application program. If a debugger replaces an instruction in a shared library with a special break instruction, then any of the applications which are currently using the shared library could erroneously hit the break point and halt operation.
To solve this problem, debuggers typically cause the operating system to make a special copy of all shared libraries used by the application being debugged. Other applications are prevented from accessing the copy of the shared libraries. However, this can be a complex and expensive method for allowing debugging. This requires the operating system to make a copy of all of the shared code whether it will actually be executed or not. This can lead to quite extensive copying as it means that the operating system must copy all the shared code which could possibly be used by the application and any additional shared code which the copied shared code could utilize, and so on.
In addition, when shared code management employs methods in which the shared code is not made visible to the application until and if it is needed (i.e., load on demand), the task is significantly compounded in difficulty for the debugger. For example, when deferred binding is utilized, this delays the linkage of shared code until just before it is used at run-time. See, for example, Programming on HP-UX, HP 9000 Series 700/800 Computers, available as HP Part No. B2355-90652, from Hewlett-Packard Company, having a business address of 3000 Hanover Street, Palo Alto, Calif. 94304, January 1995, p 5-14.
This means that the need for shared code (and a special copy thereof) may not be evident before runtime. This makes it extremely difficult to determine which shared code could possibly be used by an application in time to make a copy of the shared code for use by the debugger.
SUMMARY OF THE INVENTION
In accordance with the preferred embodiment of the present invention, dynamic translation is used during debugging of a first application. The first application resides in a computing system in which blocks of code within a shared library are utilized by the first application. The blocks of code within the shared library are also available to be utilized by other applications in the system. During runtime, the first application is dynamically translated to produce translated code. The dynamic translation includes translation of a first block of code used within the shared library to produce a translated block of code. The translated block of code is included within the translated code. Debugging code, such as a break instruction, may then be added to the translated code.
In an alternative embodiment of the present invention only blocks of code within the shared library which are called by the first application or modified by the debugger are dynamically translated. The object code for the first application is executed without being dynamically translated.
A block of code is a grouping of one or more instructions. The block of code may thus consist of a single instruction, a straight-line run of instructions terminated by a branch (similar to a “basic block” as used by a compiler), an entire procedure, or some other grouping of instructions. In the preferred embodiments of the present invention, the block of code is the unit of translation utilized by a dynamic translator. This unit of translation may be, for example, a procedure, a basic block, a page, a cache line, an instruction, or some other grouping of instructions.
There are several significant advantages of the present invention over the prior art. For example, the dynamic translator only creates a translation for code which is to be executed. A large percentage of virtually all existing code is usually not executed because it exists to handle unusual and/or exceptional cases. As opposed to prior art methods where the operating system must copy all of the shared code which could possibly be called by an application, the present invention requires only that shared code actually accessed by the application at runtime or by the debugger is actually translated.
REFERENCES:
patent: 5432795 (1995-07-01), Robinson
patent: 5442766 (1995-08-01), Chu et al.
patent: 5507030 (1996-04-01), Sites
patent: 5583988 (1996-12-01), Crank et al.
“PA-RISC 1.1 Architecture and Instruction Set Manual”, Hewlett Packard, HP Part No. 09740-09939, Feb. 1994, p. 5-138.
R. Cmelik, D. Keppel “Shade: A Fast Instruction-Set Simulator for Execution Profiling”, 1994 ACM Sigmetrics Conference, 1994.
R. Cmelik, D. Keppel “Shade: A Fast Instruction-Set Simulator for Execution Profiling”, Technical Report UWCSE 93-06-06, 1993.
T. Halfhill, “Emulat
Burch Carl D.
Buzbee William B.
Institute for the Development of Emerging Architectures LLC
Le Dieu Minh
LandOfFree
Use of dynamic translation to provide breakpoints in... does not yet have a rating. At this time, there are no reviews or comments for this patent.
If you have personal experience with Use of dynamic translation to provide breakpoints in..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Use of dynamic translation to provide breakpoints in... will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-2584130