go-delve / delve

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

[BUG] `rev` command not available #3719

Closed WangYihang closed 2 months ago

WangYihang commented 2 months ago
  1. What version of Delve are you using (dlv version)?

    $ dlv version  
    Delve Debugger
    Version: 1.22.1
    Build: $Id: 0c3470054da6feac5f6dcf3e3e5144a64f7a9a48 $
  2. What version of Go are you using? (go version)?

    $ go version                                         
    go version go1.22.0 linux/amd64
  3. What operating system and processor architecture are you using?

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 23.10
    Release:        23.10
    Codename:       mantic
  4. What did you do?

    Tried to run rev subcommand in a dlv debugging session.

  5. What did you expect to see?

    rev subcommand performs as it is documented.

  6. What did you see instead?

    (dlv) b main.main
    Breakpoint 1 set at 0x49b2aa for main.main() ./main.go:5
    (dlv) c
    > main.main() ./main.go:5 (hits goroutine(1):1 total:1) (PC: 0x49b2aa)
       1: package main
       2:
       3: import "fmt"
       4:
    =>   5: func main() {
       6:         fmt.Println("Hello, World!")
       7: }
    (dlv) next
    > main.main() ./main.go:6 (PC: 0x49b2ae)
       1: package main
       2:
       3: import "fmt"
       4:
       5: func main() {
    =>   6:         fmt.Println("Hello, World!")
       7: }
    (dlv) rev
    Command failed: command not available
aarzilli commented 2 months ago

rev (and rewind) are only available if --backend=rr is used (and rr needs to be installed and its requirements met).

WangYihang commented 2 months ago

Thank you for your prompt response.

Before opening the issue, I went through the documentation but didn't find relevant instructions.

It would be very helpful if the documentation could mention that this feature only works when rr is used as the backend.

Thanks again for your quick feedback.