Patent ID: 7840845

Claim:
A method for setting a breakpoint, the method comprising: receiving at least one input specifying a location for insertion of a breakpoint in an executable program located in a main memory, the at least one input selected from the group consisting of an instruction, a label, a line number, and a function name; determining a breakpoint address for insertion of the breakpoint in the executable program by mapping the specified location to the breakpoint address; moving an original instruction at the breakpoint address in the main memory to a separate memory location, the separate memory location selected from the group consisting of an external device and a debugger; (a) if a locked line exists in a cache memory, then writing a breakpoint instruction into the locked line of the cache memory at the breakpoint address, the cache memory being physically separate from the main memory, and determining whether the breakpoint is one of a software breakpoint and a hardware breakpoint: (a. i.) if the breakpoint is the hardware breakpoint, then storing the breakpoint address into a breakpoint register associated with a computing device, (a. ii.) if the breakpoint is the software breakpoint and the breakpoint address is located in writable space of the main memory, then moving an original instruction at the breakpoint address in the main memory to a separate memory location and writing the breakpoint instruction into the main memory at the breakpoint address, and (a. iii.) if the breakpoint is the software breakpoint and the breakpoint address is not located in writable space of the main memory, then (a. iii. 1.) writing the breakpoint instruction into a locked line of the cache memory that corresponds to the breakpoint instruction, (a. iii. 2.) copying a line corresponding to the breakpoint address from the main memory, (a. iii. 3.) writing the copied line to the cache memory at the breakpoint address, (a. iii. 4.) writing the breakpoint instruction into the copied line of the cache memory at the breakpoint address, and (a. iii. 5.) locking the line containing the breakpoint instruction into the cache memory, for conditions (a.i) to (a.iii), when the break point instruction is executed, then transferring control from the executable program to the debugger; (b.) if a locked line does not exist in the cache memory, then rejecting the breakpoint and notifying a user.