go-delve / delve

Delve is a debugger for the Go programming language.
MIT License
23.01k stars 2.14k forks source link

Internal debugger error: <nil> not an Int #3129 did not solve problem. #3363

Closed GitHubUserC closed 1 year ago

GitHubUserC commented 1 year ago

3129 did not solve my problem. Can you please help me to solve this error? Thanks.

  1. What version of Delve are you using (dlv version)?
    Delve Debugger
    Version: 1.4.0
    Build: $Id: 67422e6f7148fa1efa0eac1423ab5594b223d93b $
  2. What version of Go are you using? (go version)? go version go1.20.3 linux/amd64
  3. What operating system and processor architecture are you using?
    Description:    Ubuntu 22.04.2 LTS
    Architecture:            x86_64
  4. What did you do?
    
    package main

import ( "fmt" "github.com/consensys/gnark-crypto/ecc/bn254/fr" )

func main() { var x, y, z, z8 [8]fr.Element for i := 0; i < 8; i++ { x[i].SetRandom() y[i].SetRandom()

    z[i].Mul(&x[i], &y[i])
}

fmt.Printf("%#X %#X %#X %#X\n", x[0][0], x[0][1], x[0][2], x[0][3])
fmt.Printf("%#X %#X %#X %#X\n", z[0][0], z[0][1], z[0][2], z[0][3])

}

9. What did you expect to see?

I import [a third-party library](https://github.com/consensys/gnark-crypto) that uses Golang assembly, and I want to debug the assembly code, for example to see the values of registers at some steps, but when I use it, an error occurs as next.

11. What did you see instead?

$ dlv debug main.go --check-go-version=false Type 'help' for list of commands. (dlv) b main.go:14 Breakpoint 1 set at 0x4c9e5e for main.main() ./main.go:14 (dlv) c Command failed: Internal debugger error: not an Int runtime.gopanic (0x4365b2) /usr/local/go/src/runtime/panic.go:884 go/constant.Int64Val (0x620c05) /usr/local/go/src/go/constant/value.go:516 github.com/go-delve/delve/pkg/proc.(Variable).parseG.func1 (0x6f7428) /home/asus/go/src/github.com/derekparker/delve/pkg/proc/variables.go:822 github.com/go-delve/delve/pkg/proc.(Variable).parseG (0x6f6f81) /home/asus/go/src/github.com/derekparker/delve/pkg/proc/variables.go:846 github.com/go-delve/delve/pkg/proc.GetG (0x6f3e8d) /home/asus/go/src/github.com/derekparker/delve/pkg/proc/variables.go:247 github.com/go-delve/delve/pkg/proc/native.(nativeThread).SetCurrentBreakpoint (0x74ca39) /home/asus/go/src/github.com/derekparker/delve/pkg/proc/native/threads.go:131 github.com/go-delve/delve/pkg/proc/native.(nativeProcess).stop (0x74aa92) /home/asus/go/src/github.com/derekparker/delve/pkg/proc/native/proc_linux.go:527 github.com/go-delve/delve/pkg/proc/native.(nativeProcess).ContinueOnce (0x747297) /home/asus/go/src/github.com/derekparker/delve/pkg/proc/native/proc.go:271 github.com/go-delve/delve/pkg/proc.(Target).Continue (0x6ea2cf) /home/asus/go/src/github.com/derekparker/delve/pkg/proc/target_exec.go:70 github.com/go-delve/delve/service/debugger.(Debugger).Command (0x754658) /home/asus/go/src/github.com/derekparker/delve/service/debugger/debugger.go:856 github.com/go-delve/delve/service/rpc2.(RPCServer).Command (0x7e00d6) /home/asus/go/src/github.com/derekparker/delve/service/rpc2/server.go:124 reflect.Value.call (0x4d0cca) /usr/local/go/src/reflect/value.go:586 reflect.Value.Call (0x4cff7b) /usr/local/go/src/reflect/value.go:370 github.com/go-delve/delve/service/rpccommon.(*ServerImpl).serveJSONCodec.func3 (0x889cb9) /home/asus/go/src/github.com/derekparker/delve/service/rpccommon/server.go:338 runtime.goexit (0x468ee0) /usr/local/go/src/runtime/asm_amd64.s:1598



_Originally posted by @GitHubUserC in https://github.com/go-delve/delve/issues/3133#issuecomment-1539903745_
aarzilli commented 1 year ago

Closing, duplicate of #3129. Delve 1.4.0 does not support 1.20 and it will tell you that and that's why you have to pass --check-go-version=false to get to this.