3 ms·
There are two possible debug modes: "software", which is what people are normally used to in Visual Studio etc, and "hardware", which involves connecting an in-
by pjc50 2y ago
There are two possible debug modes: "software", which is what people are normally used to in Visual Studio etc, and "hardware", which involves connecting an in-circuit debugger to a CPU from the outside (usually over JTAG, or ARM SWD single-wire-debug).
Hardware mode does indeed halt the processor completely when you hit a breakpoint. You can then inspect its state from outside. You can do this kind of breakpoint inside a hardware interrupt service routine if you need to. The software on the target is completely undisturbed, except for the amount of time taken. This is routine in microcontroller development. It's more work to do JTAG debugging on a modern Intel CPU but it's also possible: https://www.asset-intertech.com/resources/blog/2016/07/the-three-types-of-jtag-access-on-intel-based-designs/ https://www.asset-intertech.com/resources/blog/2016/07/the-t...
(not 100% sure how halted you can get an Intel CPU in this kind of state, but for OS debugging the answer is probably pretty comprehensively halted on all units)
Software mode implements single step by simply placing a temporary breakpoint on the next instruction. Return control to target process, run the instruction, breakpoint transfers control back to OS, debug process moves the breakpoint to the next instruction, and so on.
You can have a software debugger even on very old systems. They used to be called "monitors". https://en.wikipedia.org/wiki/Resident_monitor https://en.wikipedia.org/wiki/Resident_monitor , as in the M of "CP/M".
- voidUpdate 2y agoRight, so I'm vaguely familiar with the "hardware" style, and I think that's what was confusing me since the computer itself keeps running, but that single process stops, which didn't jive with what I knew about debugging. Thank you =) And yes, now that you mention "monitors", I think I remember seeing some for the C64 and such like in the past