1. A method comprising: determining a debug event; selecting a controller context based on the determined debug event; and executing the selected controller context, wherein executing the selected controller context comprises determining whether the selected controller context is to enter a sleep mode, and wherein, if the selected controller context is to enter the sleep mode, the method further comprises: determining a second debug event; selecting a second controller context based on the determined debug event; and executing the selected second controller context.