Skip to content

Do the threads returned by a ThreadsHandler need to be real threads? #566

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

Closed
rjmholt opened this issue Apr 17, 2021 · 2 comments · Fixed by #567
Closed

Do the threads returned by a ThreadsHandler need to be real threads? #566

rjmholt opened this issue Apr 17, 2021 · 2 comments · Fixed by #567

Comments

@rjmholt
Copy link
Contributor

rjmholt commented Apr 17, 2021

Today, a ThreadsHandler returns a Container<System.Threading.Thread> and debugger events send through the ID of the affected thread.

In a world where most of our backend is async we don't really have a specific thread for anything we're debugging (in PowerShell we technically do, but it's kind of hard to get to).

So if we want to send back a thread through the ThreadsHandler, the easiest thing to do is to create a dummy thread object to represent the debugged thread -- but if that's the case, we might be better off with an O#-defined object to represent a thread.

Today we send back an empty container and always set AllThreadsStopped and AllThreadsContinued, but that might not be a good way to go...?

@rjmholt
Copy link
Contributor Author

rjmholt commented Apr 17, 2021

In particular I notice there's a type called Omnisharp.Extensions.DebugAdapter.Protocol.Models.Thread that seems appropriate for this

@yevgeni-zolotko
Copy link

I also noticed the same issue. I think this is a bug in a code generator which confuses Omnisharp.Extensions.DebugAdapter.Protocol.Models.Thread with System.Threading.Thread.
This leads to a JSON serialization exception, so using the threads request crashes the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants