by pjc50 · 2y ago · 0 comments
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-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 , as in the M of "CP/M".
And yes, now that you mention "monitors", I think I remember seeing some for the C64 and such like in the past