Claims
- 1. A method of implementing a software breakpoint in a processor system having at least one processor coupled to a main memory, and an instruction cache associated with the processor, a breakpoint code being insertable at a particular location in the instruction cache, the method comprising the steps of:
setting a control indicator associated with the particular location to a first state which allows the breakpoint code to be returned to the processor from the instruction cache in response to a first fetch request directed to a corresponding address; subsequently setting the control indicator associated with the particular location to a second state which directs that a second fetch request to the corresponding address be serviced from the main memory; and changing the control indicator state after a determination has been made, from the control indicator having been set to the second state, that the second fetch request to the corresponding address will be serviced from the main memory.
- 2. The method of claim 1 wherein the control indicator is set to the second state after a determination has been made, based on the control indicator having been set to the first state, that the breakpoint code will be returned to the processor from the instruction cache in response to the first fetch request.
- 3. The method of claim 1 wherein the changing step further comprises setting the control indicator state back to the first state from the second state.
- 4. The method of claim 1 wherein the processor system comprises a multiprocessor system having a plurality of processors each coupled to the main memory, each of the processors having an instruction cache associated therewith.
- 5. The method of claim 4 wherein the software breakpoint comprises an exclusive software breakpoint to be taken by each of a subset of the plurality of processors.
- 6. The method of claim 4 wherein the software breakpoint comprises an exclusive software breakpoint to be taken only by a single one of the plurality of processors.
- 7. The method of claim 1 wherein the control indicator comprises one or more debug control bits associated with a given set of the instruction cache.
- 8. The method of claim 1 wherein the first state comprises a debug lock state and the second state comprises a don't use once state.
- 9. The method of claim 1 wherein the control indicator specifies at least one additional state, comprising a normal mode of operation state specifying operation without utilization of the software breakpoint.
- 10. The method of claim 1 wherein the processor upon execution of the breakpoint code enters a debug mode of operation.
- 11. The method of claim 1 wherein while the control indicator is in the first state, a miss event in the instruction cache does not lead to replacement of the breakpoint code in the particular location in the instruction cache.
- 12. The method of claim 1 wherein the breakpoint code inserted at the particular location in the instruction cache is inserted for an instruction address having a noncacheable attribute associated therewith.
- 13. The method of claim 1 wherein the breakpoint code is inserted at the particular location in the instruction cache under the control of a debugger which interfaces with the processor system.
- 14. The method of claim 1 wherein the breakpoint code inserted at the particular location in the instruction cache comprises a debug opcode.
- 15. The method of claim 1 wherein at least a subset of the setting and changing steps are implemented at least in part in cache control logic associated with the instruction cache.
- 16. A processor system comprising:
a main memory; at least one processor coupled to the main memory; and an instruction cache associated with the processor; wherein a breakpoint code is insertable at a particular location in the instruction cache; wherein a control indicator associated with the particular location is settable to a first state which allows the breakpoint code to be returned to the processor from the instruction cache in response to a fetch request directed to a corresponding address, and to a second state which directs that a subsequent fetch request to the corresponding address be serviced from the main memory; and wherein the control indicator state is changed after a determination has been made, from the control indicator having been set to the second state, that the second fetch request to the corresponding address will be serviced from the main memory.
- 17. An article of manufacture comprising a machine-readable storage medium for storing one or more software programs for implementing a software breakpoint in a processor system having at least one processor coupled to a main memory, and an instruction cache associated with the processor, a breakpoint code being insertable at a particular location in the instruction cache, wherein the one or more software programs when executed implement the steps of:
setting a control indicator associated with the particular location to a first state which allows the breakpoint code to be returned to the processor from the instruction cache in response to a first fetch request directed to a corresponding address; subsequently setting the control indicator associated with the particular location to a second state which directs that a second fetch request to the corresponding address be serviced from the main memory; and changing the control indicator state after a determination has been made, from the control indicator having been set to the second state, that the second fetch request to the corresponding address will be serviced from the main memory.
RELATED APPLICATION(S)
[0001] The present invention is related to the invention described in U.S. patent application Ser. No. 10/072,529, filed Feb. 8, 2002 in the name of inventors M. R. Betker et al. and entitled “Multiprocessor System with Cache-Based Software Breakpoints,” which is hereby incorporated by reference herein.