delve icon indicating copy to clipboard operation
delve copied to clipboard

Function calls are not supported on conditional breakpoints

Open dlsniper opened this issue 5 years ago • 3 comments

  1. What version of Delve are you using (dlv version)? Delve Debugger Version: 1.3.2 Build: 3c266810757cd4abafe46fc6c9203aeeef5e15bf

  2. What version of Go are you using? (go version)? Go 1.13.4

  3. What operating system and processor architecture are you using? windows/amd64

  4. What did you do? Run the following app in debug mode:

package main

import (
	"fmt"
	"runtime"
)

func factorial(n int, withBreak bool) int {
	if withBreak {
		runtime.Breakpoint()
	}

	if n == 0 {
		return 1
	} else {
		return n * factorial(n-1, withBreak)
	}
}

func main() {
	factorial(10, false)
	fmt.Println("the end")
}

Then run the following commands in delve:

b main.go:16
cond 1 factorial(n, false) == 6
c
  1. What did you expect to see? I'd expect the execution to stop at the breakpoint when the condition is met.

  2. What did you see instead?

Command failed: error evaluating expression: function calls not allowed without using 'call'

dlsniper avatar Nov 22 '19 07:11 dlsniper

+1 Just confirming.. Isn't it possible to invoke functions while in a debug session?

leoluz avatar Oct 31 '22 20:10 leoluz

Is there a plan for this issue yet?

huchaogithup avatar Jan 12 '24 07:01 huchaogithup