delve icon indicating copy to clipboard operation
delve copied to clipboard

Support call injection for functions that have type parameters

Open crowod opened this issue 1 year ago • 2 comments
trafficstars

Please answer the following before submitting your issue:

Note: Please include any substantial examples (debug session output, stacktraces, etc) as linked gists.

If this is about source listing not showing up (or breakpoints not being accepted) while running in a container please read our FAQ first.

  1. What version of Delve are you using (dlv version)? Version: 1.22.0
  2. What version of Go are you using? (go version)? go version go1.21.5 darwin/arm64
  3. What operating system and processor architecture are you using? darwin/arm64
  4. What did you do? When debugging in VSCode and calling a function in the evaluate expression, an error occurs. Unable to evaluate expression: could not find symbol value for slices
  5. What did you expect to see? The slices.Contains call returns normally.
  6. What did you see instead? image

crowod avatar Jan 13 '24 09:01 crowod

Calling functions with type parameters is not supported and there are significant complications to implementing it: it's impossible to do it in the general case, where the instantiated version doesn't exist in the binary, (it would require debug time code generation) and when the instantiated version does exist it's still difficult because we have no way to find the right dictionary to pass.

aarzilli avatar Jan 13 '24 09:01 aarzilli

Calling functions with type parameters is not supported and there are significant complications to implementing it: it's impossible to do it in the general case, where the instantiated version doesn't exist in the binary, (it would require debug time code generation) and when the instantiated version does exist it's still difficult because we have no way to find the right dictionary to pass.

Can it be achieved in the future? I used to do this kind of operation frequently in Python and Java before. It has caused me some troubles that I cannot do the same thing while debugging in Go.

crowod avatar Jan 13 '24 09:01 crowod