-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Expected treatment of threads in debug viewlet UI? #40
Comments
Yes, this is a bug on the VSCode side. The issue seems to be that we only show the thread in the call stack once a stopped event has happened for that thread. I can fix the issue but it requires testing so I propose to do it after connect event. |
After investigating this a bit further, I have some more questions:
Let me know what you think |
Assigning to @lukehoban so he reads my comment |
Sorry - missed your reply earlier.
No, I don't do this yet, and that is likely the root problem. I see how this is done in the Mono debugger and that makes sense. Unfortunately, this won't map as easily to the Go debugger as it does in the Mono case. The Delve debugger does not provide any events, only host-initiated RPC commands. I think that's reasonably common for a class of debuggers primarily used through a command line interface. So to implement this, we will need to get all the threads and compute which are new or stopped to send the events. It feels like the vscode debugger could just be doing that itself since we already provide the ability to list threads. Is there any reason why you need these events vs. just computing the threads to show based on the
Okay - that makes sense. I think I was just confused because I was seeing multiple threads show stack traces at once in some cases - but probably that was because of not sending the right thread events. |
Yes I could do something like you proposed. |
What I am seeing, is that upon hitting a breakpoint, the adaptor must report all threads in the process as stopped, otherwise vscode seems to think they are still running and won't display their callstacks. |
Oh, and if I report stops for all threads, the debugger UI seems to select which one to display as current randomly, which can lead to confusion as to which thread has caused the stop. |
@vadimcn thanks for the feedback! We are aware of some of the issues you mentioned. Currently we are looking into improving/fixing issues around our thread architecture and this will probably be improved for our January release. Will keep you updated. |
Any updates? The next release is nigh, but I am still seeing the same issues with threads display. |
Unfortunately, this has not been tackled for January. We will look into improving our thread model in our February release. |
Yes, I'm finding the same issue with my debugger extension. It's making multi-threaded debugging painful with the UI jumping to different sources on each break. FWIW, I would prefer it if |
And it would be nice if the threads display prioritised stopped threads over running threads in the order it displays them. I'm finding that on a lot of occasions, the thread that has stopped is the last created thread - which puts it at the bottom of the list requiring the user to scroll down to it. |
@adelphes, I have not seen this issue for many months. VSCode displays the correct thread as long as you pass its id in the stop event. |
Closing as this issue is ancient, let's keep the discussion here #19858 |
I’m seeing some odd behavior around how threads are being rendered in the Code debugger for the Go debugger extension. But I’m also not certain what I should be expecting to see, as I don’t think I’ve seen any examples of debuggers which show thread information in Code.
The Go debugger returns a list of threads from
DebugSession#threadsRequest
, but these are not displayed anywhere. However, it seems that if I’ve ever hit a breakpoint on a different thread before, then later breakpoints will cause a second root node to appear in the Call Stack window showing the stacks associated with the 2 threads I've hit breakpoints on at some point (out of the 10 or so threads I’ve reported as existing).On the thread that is not the active thread, the call stack displayed appears to be the call stack from the previous breakpoint I was at, not the active call stack on that thread at the current point. And in fact, in both cases, my
DebugSession#stackTraceRequest
implementation is only being called once (for the thread the breakpoint was hit on), not for any of the other threads I reported.After hitting first breakpoint:
After hitting second breakpoint:
The text was updated successfully, but these errors were encountered: