Skip to content

dap: make variable load limits configurable#4385

Open
larrasket wants to merge 1 commit into
go-delve:masterfrom
larrasket:dap-configurable-load-limits
Open

dap: make variable load limits configurable#4385
larrasket wants to merge 1 commit into
go-delve:masterfrom
larrasket:dap-configurable-load-limits

Conversation

@larrasket

Copy link
Copy Markdown

the server hardcoded MaxStringLen (512) and MaxArrayValues (64) in DefaultLoadConfig with no way to adjust them, debugging sessions that need to see longer strings or larger collections had to page through reloads or use the dlv connection workaround.

this adds maxStringLen and maxArrayValues to the launch/attach configuration and to the config evaluation request.
Fixes #4064

The DAP server hardcoded MaxStringLen (512) and MaxArrayValues (64) in
DefaultLoadConfig with no way to adjust them, so debugging sessions that
need to see longer strings or larger collections had to page through
reloads or use the dlv connection workaround.

Add maxStringLen and maxArrayValues to the launch/attach configuration
and to the config evaluation request ("dlv config maxStringLen 4096" in
the debug console). The limits override DefaultLoadConfig through a new
Session.loadConfig method; contexts that deliberately relax a limit
(single string evaluation, call return values, paging) keep doing so on
top of the configured base.

Fixes go-delve#4064
Comment thread service/dap/types.go

// Maximum number of bytes loaded for strings.
// Default is 512.
MaxStringLen int `json:"maxStringLen,omitempty"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to this struct need to also be documented by updating the corresponding json descriptions in vscode-go. For example: https://go-review.googlesource.com/c/vscode-go/+/753000

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aarzilli aarzilli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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 this pull request may close these issues.

Feature: Add possibility to configure max string/bytes limits for on-demand content loading for debug

2 participants