Implement async-break
commit4429608e3c1c6d0f5e0f584318fcb37547a5873c
authorArnab De <arnabde@fb.com>
Tue, 30 Nov 2021 15:43:50 +0000 (30 07:43 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 30 Nov 2021 15:46:21 +0000 (30 07:46 -0800)
tree76906513d9623d9dd686eabacf4691bd2db72c44
parentab3ea242c81b8fdecdbff8c854c6c5861c7c0ae3
Implement async-break

Summary:
There are two issues with async-break in VSCode:
1. A `pause` message with `preserveFocusHint` true does not trigger the UI to change from "running" mode to "paused" mode. Therefore although HHVM gets paused, it is not evident in the UI.
2. The `PauseCommand` sent by the client always has `threadId == 1`, no matter which threads' pause button is pressed. This makes it impossible for the pause command to target a specific thread.
We introduce a new program state for async-breaks. When a 'pause' message is sent in this mode, it sets `preserveFocusHint` to false. It causes all the requests to pause and VSCode opens the files where every request is paused. This is not ideal, but async breaks are used sparingly and it does not affect other commands. With the UI issues mentioned above, we may not have any way around this behavior.

Reviewed By: jeffreytan81

Differential Revision: D32600305

fbshipit-source-id: 3c0c28209d0805e58730eb74766b772ca72ccd6c
hphp/runtime/ext/vsdebug/debugger.cpp
hphp/runtime/ext/vsdebug/debugger.h