View Single Post
chiro
#6
Feb22-12, 09:54 PM
P: 4,572
If you are using a language with exception catch an exception.

If you are using something where you can add a kind of interrupt hook, then use that. Chances are if you are developing in an environment, then you will be able to do this.

From this website:

The Kernel's Trap Handler

The kernel's trap handler mediates handling of interrupts, exceptions, system service calls, and virtual memory management.

The difference between interrupts and exceptions is that interrupts occur asynchronously (for instance, when hardware peripheral devices needs processor attention), and exceptions occur as a part of standard application execution (for instance, when a math overflow occurs). So, exceptions are generally reproducable, but interrupts involve timing relationships that are difficult to reproduce.