delve
delve copied to clipboard
Unable to evaluate expression: cannot use b.String as argument b in function strings.(*Builder).String: stack object passed to escaping pointer: b
trafficstars
Unable to evaluate expression: cannot use b.String as argument b in function strings.(*Builder).String: stack object passed to escaping pointer: b

- What version of Delve are you using (
dlv version)? 1.9.1 - What version of Go are you using? (
go version)? 1.19.2 - What operating system and processor architecture are you using?
goos: linux
goarch: amd64
pkg: iteration
cpu: Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz
- What did you do? Ran
call b.String()orcall b.Len() - What did you expect to see? the value returned
- What did you see instead?
Unable to evaluate expression: cannot use b.String as argument b in function strings.(*Builder).String: stack object passed to escaping pointer: b
This is by design at the moment, we don't know which arguments escape so all arguments must be heap allocated. The command line client has a -unsafe option but I don't think that applies to vscode-go.
I met this problem :-(
any workarounds?
I just ran into this. For me a functional work around was to use the internal buf of Builder (eg. string(b.buf))