Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear memory breakpoints if quitting from the debugger #311

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TheTurtleIsHungry
Copy link

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.

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 letting it quit.
By calling deinitialize_memwatch(), the memory breakpoints won't cause problems. Not sure if this affects code breakpointsm but my change wouldn't fix that.

deinitialize_memwatch() could maybe be called from within uae_quit, but I'm not confident in the side effects.
@tonioni
Copy link
Owner

tonioni commented Oct 22, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants