-
Notifications
You must be signed in to change notification settings - Fork 127
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
Feature request: Stop debugger until first client connects #739
Comments
In the use case you described, do you always have breakpoints set in your tests? If the answer is yes, then using |
Yes -- in VS Code.
The problem is that the breakpoints get set just after VS Code attaches. VS Code is doing the breakpoint setting. |
Hi, I understand your request that
Right? Can I ask something?
Maybe (c) is most easy way for you because you don't need to launch VSCode and attach to the debuggee if no breakpoints are reached. When it stops at breakpoint, you can attach to the debuggee (test process) at that time. In fact, vscode-rdbg supports to export breakpoints. But not supported by debug.gem to load it because of some security concerns. I want to ask which is the best. Honestly speaking |
@ko1: yes, your description of our requirements is correct. Also, I agree that my proposed solution is hacky, and doesn't follow any of the patterns that the debug gem already uses, so I'd be happy to see another solution. Regarding your options: a. is #747 (which we agree is not the best) |
@ko1 can you say more about:
This issue is the last thing that is preventing Stripe from using the gem without forking it, and we'd love to help move the feature along :) |
attach configuration in launch.json file `"nonstop": true` option is supported. If nonstop is true, do not pause on attach timing. fix #739
#792 (comment) adding (b). |
attach configuration in launch.json file `"nonstop": true` option is supported. If nonstop is true, do not pause on attach timing. fix #739
For (c) please try:
and it debuggee process will stop at the breakpoint and you can attach from VSCode. Extension.Development.Host.sample.rb.-.simple_sample.WSL_.Ubuntu-20.04.-.Visual.Studio.Code.2022-11-04.06-25-42.mp4Now VSCode extension has an issue (breakpoint line is wrong with -1 because of 0-origin and 1-origin issue) but it will be fixed soon. |
Your proposal
Make it possible for the debugger to pause the program until the first client connects:
Once the first client connects, the program can proceed.
Additional context
We are working to integrate
debug.rb
into Stripe's Ruby test runner. The test runner needs to start the server and wait for VS Code to connect before running the tests.debug/open
does not work for this use case.debug/open
pauses the program when the debugger starts, but does not resume the program after VS Code connects. Instead, VS Code reports the program as paused on a breakpoint in our test runner code. The user then has to hit "resume" to run their tests and hit the breakpoints that they actually set.The text was updated successfully, but these errors were encountered: