-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Feat: naive waitFor preattach/attach support #13464
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
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
I like the idea of this - I think we'd need to make sure this was working for all platforms. I'm a bit nervous about how to make the polling robust as possible (and available across the platforms) - the looping around grabbing the processes is a bit of a wide-casting net (getting all the processes and then parsing the results) - we should probably make it so that we're only asking PS for the processes that are likely matches (but that complicates things with just having an expression obviously) We'd need another way to suspend the process on Windows (given the lack of SIGSTOP). Not impossible. I had been thinking a while back if a script launched before debugging might be another way to go to do this - If a task was created to poll in a loop and suspend the matched process, but then we'd still need to have the editor know when to start attaching. I'll bring it up with some other folks and see what they think. |
I don't think it necessarily needs to work on Windows, as long as the user can find out that it's not supported. Others might disagree though. |
RE: avoiding polling I also don't think Windows parity is required. We could support it for |
Indeed, the /proc polling is the approach I'm more fond of if you think Linux only support is ok, at least for now . |
I think I spoke too soon. |
Hello :)
Coming from this #13463 thread where I explain a bit the aim and context, but to sum it up:
This is a naive approach I came up with, but tested with success in our C++ codebases for the company I'm working on.
The SIGSTOP, as I mentioned in #13463, is something that could be optional or specified as key for the waitFor properties. but at least for decent size C++ code the symbols loading and debugger startup (be LLDB or GDB) could be slow ~15-20secs, so we need to SIGSTOP and handle that in GDB side.
I'm not a Typescript dev at all, probably there's some work and room to improvements, but I think is a decent step to propose here and discuss with you if you're up to include as functionality.
There's pending changes to apply, but I preferred to upload the current status and continue if you're interested.
Thanks!