Delve: Support map evaluation by composite literal keys

Created on 17 Jan 2019  路  1Comment  路  Source: go-delve/delve

  1. What version of Delve are you using (dlv version)?
$ dlv version
Delve Debugger
Version: 1.1.0
Build: $Id: 1990ba12450cab9425a2ae62e6ab988725023d5c $
  1. What version of Go are you using? (go version)?
$ go version
go version go1.11.2 linux/amd64
  1. What operating system and processor architecture are you using?

Linux/amd64

  1. What did you do?

Compile the following program, debug it with delve, try to print some map values:

package main

import "fmt"

type Pair struct {
        A, B int
}

func main() {
        m := map[Pair]string{}
        m[Pair{A: 1, B: 1}] = "x"
        m[Pair{A: 1, B: 2}] = "y"
        fmt.Println(m)
}
$ dlv debug test.go
(dlv) b main.main:4
...
(dlv) c
...
(dlv) p m[main.Pair{A: 1, B: 1}]
Command failed: expression *ast.CompositeLit not implemented
(dlv) p m[Pair{A: 1, B: 1}]
Command failed: expression *ast.CompositeLit not implemented
  1. What did you expect to see?

Print the corresponding map values.

  1. What did you see instead?

"Command failed: expression *ast.CompositeLit not implemented"

Looks like CompositeLit evaluation wasn't implemented: https://github.com/go-delve/delve/blob/4c9a72e486f1f0d0c90ecede8415a871dced8117/pkg/proc/eval.go#L258

areproc kinenhancement

Most helpful comment

any progress here ?
I think this is really important feature.. at least with cmd-line debugging.

>All comments

any progress here ?
I think this is really important feature.. at least with cmd-line debugging.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saleemjaffer picture saleemjaffer  路  4Comments

aybabtme picture aybabtme  路  3Comments

goen picture goen  路  5Comments

NanXiao picture NanXiao  路  3Comments

wxqzhy picture wxqzhy  路  4Comments