1. A method, comprising: determining whether a software debug event is pending; determining whether a hardware debug event is pending; when the software debug event is being handled, fetching a first instruction of a software debug program; when the software debug event is being handled, executing the first instruction of the software debug program; after said step of fetching the first instruction of the software debug program and before said step of executing the first instruction of the software debug program, handling the hardware debug event when the hardware debug event is pending; and after said step of handling the hardware debug event, completing execution of the software debug program.