gvwilson / sdxpy

Software Design by Example: a tool-based introduction with Python
https://third-bit.com/sdxpy/
Other
373 stars 55 forks source link

Fixed bug in VM debugger for adding/clearing breakpoints #258

Closed Aquamarine-12 closed 10 months ago

Aquamarine-12 commented 11 months ago

If you try adding a breakpoint and this operation fails (because there is already a breakpoint at that address), the debugger will step to the next instruction, which seems to be unintended behaviour. The same happens for trying to clear a breakpoint at an address where there is no breakpoint. This happens because these two commands return None in case of failure, which interferes with the loop from interact() in vm_extend.py (the variable interacting becomes None, breaking the loop and allowing the VM to step to the next instruction).