Skip to content
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

debug: show only user goroutines by default #1797

Open
hyangah opened this issue Sep 22, 2021 Discussed in #1754 · 6 comments
Open

debug: show only user goroutines by default #1797

hyangah opened this issue Sep 22, 2021 Discussed in #1754 · 6 comments
Assignees
Labels
debug/callstack callstack handling related debug issues Debug Issues related to the debugging functionality of the extension. FeatureRequest
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Sep 22, 2021

Discussed in #1754

Originally posted by suzmue September 7, 2021
Using a debugger to debug a Go program reveals a lot of the Go runtime implementation details to the user. Several goroutines that belong to the runtime appear in the call stack, cluttering the view and making a simple program seem very complicated.

For example when debugging a simple hello world program, 5 different goroutines appear in the callstack:
Program stopped on a breakpoint in main.go:
Screen Shot 2021-09-03 at 2 28 41 PM

Call stack:
Screen Shot 2021-09-03 at 2 28 48 PM

This proposal is to (by default) only show the user goroutines in the call stack. When using this new default, the call stack for hello world will only show a single goroutine, as would be expected from a simple program with no concurrency:

Screen Shot 2021-09-07 at 12 36 41 PM

This would be controlled by a setting to allow users that really want to see the system goroutines to include them using the launch configuration.

@suzmue
Copy link
Contributor

suzmue commented Oct 28, 2021

https://go-review.googlesource.com/c/vscode-go/+/359402 was submitted to enable this in Nightly

@polinasok
Copy link
Contributor

Should we enable this in the stable release?

@polinasok polinasok added the debug/callstack callstack handling related debug issues label Apr 8, 2022
@hyangah hyangah removed the DA: DlvDAP label Jun 7, 2022
@firelizzard18
Copy link
Contributor

Is there a way to enable this by default for all debugging sessions? 90% of my debugging is done via tests - I'd really like to be able to enable this when debugging a test, without having to create a launch.json entry for the test.

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/534955 mentions this issue: package.json: allow updating hideSystemGoroutines from stack context

gopherbot pushed a commit that referenced this issue Oct 13, 2023
Add a command to the callstack context menu that allows users to
toggle between hiding and showing system goroutines. This allows
for easier discovery of the feature.

For #1797

Change-Id: I7f085d5e7d50ec3f3ae2a9d515c99b2e935c5d3a
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/534955
Commit-Queue: Suzy Mueller <suzmue@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
@suzmue
Copy link
Contributor

suzmue commented Oct 13, 2023

@firelizzard18 sorry for the delay but adding the hideSystemGoroutines to the user settings in go.delveConfig should do this for all tests:

"go.delveConfig": {
  "hideSystemGoroutines": true
}

Added the feature to be able to toggle the threads from the context menu:

Screenshot 2023-10-13 at 1 10 06 PM

@hyangah
Copy link
Contributor Author

hyangah commented Oct 31, 2023

@suzmue Is there any extra work you planned to do during this cycle? cl/534955 made the feature accessible.
Do you want to hide the system goroutines by default?

@suzmue suzmue modified the milestones: v0.40.0, v0.41.0 Nov 16, 2023
@hyangah hyangah modified the milestones: v0.41.0, v0.42.0 Dec 19, 2023
@hyangah hyangah modified the milestones: v0.42.0, v0.43.0 Jun 4, 2024
@suzmue suzmue assigned hyangah and unassigned suzmue Jul 15, 2024
@hyangah hyangah modified the milestones: v0.43.0, v0.44.0 Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug/callstack callstack handling related debug issues Debug Issues related to the debugging functionality of the extension. FeatureRequest
Projects
None yet
Development

No branches or pull requests

5 participants