You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using libuiohook and pausing execution with a debugger (on breakpoint or an exception that has been caught), the entire system experiences severe lag. This is mainly due to the low-level hooks continuing to handle system-wide events while the application is paused, causing the event queue to back up.
Desired Behavior
The hooks should ideally be unregistered or bypassed when the debugged process is halted, not just when a debugger is attached.
System should remain responsive during debugging sessions.
Potential Solutions
At a glance, on Windows, the Win32 API has an IsDebuggerPresent() function that could aid in better understanding the environment the process is being used/ran in. However, this function gets called when the process is initially attached to a debugger rather than when the process is halted on exception or breakpoint. The obvious consequence is that we would lose the ability to observe events when a debugger is attached if we decided to unregister the hooks at this point.
Platform
Windows (when tested significant lag was present system-wide)
macOS (no significant issues when tested but in theory, the same issue could occur)
Linux (untested)
Ideally, as discussed previously with @kwhat, it could be useful to explore a solution for Windows and then expand that to the other supported operating systems. However, this may be subject to change.
The text was updated successfully, but these errors were encountered:
This will basically just stop the listener when the debugger connects. You won't be able to debug though the hook, but at least it wont prevent the keyboard and mouse from functioning.
Let me know if that works / open a pull-request. I don't have a Windows development environment setup right now so I can't really test.
The more I think about the above, the more I am not convinced it will work. You may need to add something like this around line 65 and 105
Description
When using libuiohook and pausing execution with a debugger (on breakpoint or an exception that has been caught), the entire system experiences severe lag. This is mainly due to the low-level hooks continuing to handle system-wide events while the application is paused, causing the event queue to back up.
Desired Behavior
Potential Solutions
At a glance, on Windows, the Win32 API has an IsDebuggerPresent() function that could aid in better understanding the environment the process is being used/ran in. However, this function gets called when the process is initially attached to a debugger rather than when the process is halted on exception or breakpoint. The obvious consequence is that we would lose the ability to observe events when a debugger is attached if we decided to unregister the hooks at this point.
Platform
Ideally, as discussed previously with @kwhat, it could be useful to explore a solution for Windows and then expand that to the other supported operating systems. However, this may be subject to change.
The text was updated successfully, but these errors were encountered: