Patent ID: 8910126

Claim:
A method of compiling source code for debugging, the method comprising: receiving, by an optimizing compiler from a debugger, a variable value modification profile of the source code, the variable value modification profile specifying one or more locations in the source code at which variable values were modified during a debug session; compiling, by the optimizing compiler, the source code, including: inserting a plurality of snapshots including snapshots at one or more of the locations in the source code at which variable values were modified, each snapshot including a breakpoint, wherein each snapshot comprises a directive and a specification of one or more variables, the directive enabling the user to establish a breakpoint in a debug session at the location of the snapshot and examine the specified variables when execution reaches the snapshot location; only for each snapshot at a location in the source code at which variable values were modified: inserting, between the breakpoint and the remaining source code at the location of the snapshot, a module of computer program instructions that when executed retrieves a current value of a variable and stores the current value in a register; and recording the location of each inserted snapshot; and providing, to the debugger by the optimizing compiler, the recorded locations of each inserted snapshot along with the compiled source code.