Systems and methods for debugging applications using dual code generation
AssigneeCray Inc.
InventorsRobert Warren Moench, Robert Cushman Clark
Life of this patent
Estimating the term…
Abstract
Systems and methods provide a debugger that debugs code using two versions of code, an optimized and a debuggable version of object code for subroutines, methods or functions. The debugger causes the appropriate version of the code to be executed depending on whether debug commands have been applied with respect to particular subroutines, methods or functions.
Claims16
A method for execution by one or more processors, the method comprising:
- receiving executable code having a plurality of subroutines, a subroutine of the executable code having optimized object code as a first version and having debuggable object code as a second version, the first version and the second version being distinct, the optimized object code and the debuggable object code being generated by a compiler;
- and
- when debugging the executable code,
- upon determining that the subroutine is to be debugged, causing the debuggable object code of the subroutine to be executed wherein the optimized object code is not executed and wherein causing the debuggable object code to be executed comprises inserting an instruction in the optimized object code that causes control to be transferred to the debuqqable object code;
- and
- when the subroutine is not to be debugged, causing the optimized object code to be executed wherein the debuqqable object code is not executed.
A system comprising:
- one or more processors;
- executable code for an application to be executed by the one or more processors, the executable code having a plurality of subroutines, one or more of the plurality of subroutines having a first version comprising optimized object code and a second version comprising debuggable object code, the first version and the second version being distinct, the optimized and the debuggable object codes being generated by a compiler;
- and
- a debugger executed by the one or more processors, the debugger to:
- upon determining that a subroutine is to be debugged, cause the debuggable object code to be executed by inserting an instruction in the optimized object coed that causes control to be transferred to the debuggable object code wherein the optimized object code is not executed;
- when the subroutine is not to be debugged, causing the optimized object code to be executed wherein the debuggable object code is not executed.
A computer-readable memory having stored thereon instructions for causing one or more processors to perform operations comprising:
- receiving executable code having a plurality of subroutines, one or more of the plurality of subroutines having a first version comprising optimized object code and a second version comprising debuggable object code, the first version and the second version being distinct, the optimized object code and the debuggable object code being generated by a compiler;
- and
- upon determining a subroutine is to be debugged, causing the debuggable object code of that subroutine to be executed during execution of the executable code wherein the optimized code is not executed and wherein causing the debuggable object code to be executed comprises inserting an instruction in the optimized object code that causes control to be transferred to the debuggable object code;
- and
- when that subroutine is not to be debugged, causing the optimized object code to be executed wherein the debuggable object code is not executed.
A computer-readable memory having stored thereon instructions comprising instructions for controling a computer to:
- during debugging of executable code having subroutines and when a subroutine is to be executed,
- execute a first version of the subroutine and not a second version of the subroutine when the subroutine is not being debugged;
- and
- execute the second version of the subroutine and not the first version of the subroutine when the subroutine is being debugged, execution of the second version of the subroutine caused by inserting an instruction into the first version that causes control to transfer to the second version
- wherein the first version and the second version are distinct and
- wherein the first version and the second version of the subroutine are generated by a compiler with the first version being optimized object code having an optimization and the second version being debuggable object code not having that optimization.
Dependencies are inferred from the claim text.