How to debug ISR

I dont have real exposure in debugging ISR,But in interview when i asked how would you debug an ISR , i answered by putting a break point.

Is it not that cant i put a break point and debug through windbg or put simple print statements to figure out whats happening,is there a different way,becuase after my answer interviwer didnt seem happy.

The question was bullshit. It depends on what you mean by “debug an ISR”.
You could put ASSERTs there to validate preconditions. You can keep internal log of interesting registers.

AND… putting in a breakpoint and/or some DbgPrint statements, as you answered, is a perfectly appropriate answer.

It’s probably not what the interviewer was hoping to get from his question… He was probably most disappointed that his question wasn’t clever enough to get you expound on all sorts of things, such as those mentioned by Mr Girg, above.

Peter
OSR
@OSRDrivers

xxxxx@hotmail.com wrote:

I dont have real exposure in debugging ISR,But in interview when i asked how would you debug an ISR , i answered by putting a break point.

Is it not that cant i put a break point and debug through windbg or put simple print statements to figure out whats happening,is there a different way,becuase after my answer interviwer didnt seem happy.

The difficulty in debugging an ISR is that things happen in real-time.
If you stop at a breakpoint in an ISR, your hardware is still asserting
its interrupt. We think of the machine as going into suspended
animation, but of course that’s not literally true – the computer still
has to be alive and operational, otherwise the kernel debugger wouldn’t
communicate.

The right answer is probably to say that it is tricky. Debug prints
tend to be useful, but again it’s easy to forget that those prints take
time. If you are debugging over a serial port, they take a LOT of
time. I have been in many situations where the use of debug prints
changed the timing enough that the problems changed, and in some cases
the hardware does not work.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.