Don't grab the mouse when debugging #97
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pr adds 2 main features to make our life easier:
This means that, when debugging in an IDE, the mouse won't be hidden.
Right now, the mouse is hidden when some breakpoint is hit which is annoying.
abort()
instead ofexit(1)
on a panic when a debugger is attached,such that you are thrown right to the correct spot when e.g. an unimplemented function is encountered.
I copied the code to detect a debugger on Macos from this apple faq page: https://developer.apple.com/library/archive/qa/qa1361/_index.html
There is an important note about the code not working on a release build.
Since I don't own an apple (and you do), can you take a look at this and fix it?
You probably might have to
#ifdef _DEBUG
this function and return0
when building a release binary.This is another way to detect a debugger on Macos
https://zgcoder.net/ramblings/osx-debugger-detection/#mach-exception-handlers
Since gdb is not really used by apply, perhaps this 2nd method should be used instead.