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: make it easier to display long strings while debugging #645

Closed
segevfiner opened this issue Sep 15, 2020 · 6 comments
Closed

debug: make it easier to display long strings while debugging #645

segevfiner opened this issue Sep 15, 2020 · 6 comments
Labels
Debug Issues related to the debugging functionality of the extension. Duplicate Make it obvious when issues are closed as duplicate FrozenDueToAge

Comments

@segevfiner
Copy link
Contributor

segevfiner commented Sep 15, 2020

Is your feature request related to a problem? Please describe.
delve trims strings to 64 characters by default. Very very often I have to jump through hoops around this to be able to see the string I need to figure out what went wrong. The current ways to work with this leave something to be desired.

I can index the string, each time with a larger offset to try and see the next part of the string, though that's obviously rather inconvenient.

The limit is settable via the launch configuration (I don't know if delve reads any config file when launched via VS Code?), or by the go.delveConfig configuration value. Increasing it makes it more convenient yet I'm not sure of the performance implications or why the limit is so low to begin with. Also the limit cannot be set while already debugging, which is annoying.

Describe the solution you'd like
This might need a better default, a way to set it while debugging, and/or a better way to see the whole string even with the current default, for example having a button/link next to a trimmed string that allows to view the rest of it (Not sure if that is possible with the DAP)

Describe alternatives you've considered
Just set the configuration (Possibly making it easier for new users to discover it). Keep jumping through hoops with indexing.

Additional context
Screenshot
Argh...

@hyangah hyangah changed the title Make it easier to display long strings while debugging debug: make it easier to display long strings while debugging Sep 15, 2020
@hyangah hyangah added the Debug Issues related to the debugging functionality of the extension. label Sep 15, 2020
@hyangah
Copy link
Contributor

hyangah commented Sep 15, 2020

Longer string limit is not ideal for the variables UI that pulls all the variables in scope automatically.
If there are huge strings or bytes arrays, that will slow down debugging significantly.

I wonder if we can use a different limit for the requests that come through the DEBUG CONSOLE, and make it even dynamically configurable.

cc @polinasok @suzmue @quoctruong

@gopherbot gopherbot added this to the Untriaged milestone Apr 8, 2021
@hyangah hyangah modified the milestones: Untriaged, Backlog Apr 14, 2021
@emil14
Copy link

emil14 commented Apr 28, 2021

This one should not be closed because it's a real problem

Instead it would be great if you will provide settings to control this behaviour

@arxeiss
Copy link

arxeiss commented Apr 28, 2021

@emil14 there is a setting to control this. Add those lines into JSON settings of VS Code.

    "go.delveConfig": {
        "dlvLoadConfig": {
            "maxStringLen": 5000,
            "maxArrayValues": 1000,
        },
    },

@emil14
Copy link

emil14 commented Apr 28, 2021

@arxeiss

Thank you much!

@polinasok
Copy link
Contributor

polinasok commented Apr 29, 2021

These setting are only available in the legacy adapter and are not available in dlv-dap. Please see the discussion at go-delve/delve#2144. We will be looking into ways to load these on demand in dlv-dap.

@polinasok
Copy link
Contributor

This is a dup of #1318. As the other issue has more discussion now, I am going to close this in favor of it.

@polinasok polinasok added the Duplicate Make it obvious when issues are closed as duplicate label Apr 29, 2021
@golang golang locked and limited conversation to collaborators Apr 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Debug Issues related to the debugging functionality of the extension. Duplicate Make it obvious when issues are closed as duplicate FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

6 participants