my environment is ubuntu 16.04+eclipse neon3+goeclipse
this is my source code:
package main
import "fmt"
func main() {
arr := []int{1, 2, 3}
fmt.Println(arr)
}
it is very simple and I just want to know how to check the element of array arr when debug if I set breakPoint at println.when I check arr this is what I get .As we can see I cant get the element of arr and only can get the address of arr. And it has two errors:
Failed to execute MI command:-data-evaluate-expression (arr).len Error message from debugger back end:A syntax error in expression, near 'len'.
It seemed the error has relation with gdb but I dont know how to get rid of it.
In java,as for similar code.
public class Demo {
public static void main(String[] args){
int[] arr = {1,2,3};
System.out.println(arr);
}
}
it is easy to get the element of arr when debug.
So I want to know how can I get the element of array in Go when debug and how can I get rid of the error when debug. Any advice will be appreciate.