tonioni / WinUAE

WinUAE Amiga emulator
http://www.winuae.net/
552 stars 90 forks source link

Clear memory breakpoints if quitting from the debugger #311

Open TheTurtleIsHungry opened 1 month ago

TheTurtleIsHungry commented 1 month ago

uae_quit() doesn't instantly exit, but sets a flag to exit soon. This flag is checked at regular intervals (I believe) If a memory breakpoint is hit before the flag is checked, the debugger opens up rather than quitting gracefully. By calling deinitialize_memwatch(), the memory breakpoints won't cause problems. Not sure if this is also a problem with code breakpoints as well, but if it is then my code doesn't fix that

deinitialize_memwatch() could maybe be called from within uae_quit, but I'm not confident in the side effects hence the simplest solution.

tonioni commented 1 month ago

I think it is better to check in "void debug(void)" if quit_program is set and immediately exit. This would work in all situations and also prevent all ways to enter the debugger during "exit phase" (which also includes "Restart" GUI button)

But I'll wait until custom chipset emulation rewrite is complete, lots of things will be internally different compared to 5.3.1.