go-delve/delve · error

follow exec not supported

Error message

follow exec not supported

What it means

gdbProcess.FollowExec is a stub for the gdbserial backend: it unconditionally returns 'follow exec not supported'. Follow-exec (automatically debugging child processes after execve) requires ptrace-level support the GDB remote protocol connection does not provide.

Source

Thrown at pkg/proc/gdbserial/gdbserver.go:1350

func (p *gdbProcess) WriteBreakpoint(bp *proc.Breakpoint) error {
	kind := p.breakpointKind
	if bp.WatchType != 0 {
		kind = bp.WatchType.Size()
	}
	return p.conn.setBreakpoint(bp.Addr, watchTypeToBreakpointType(bp.WatchType), kind)
}

func (p *gdbProcess) EraseBreakpoint(bp *proc.Breakpoint) error {
	kind := p.breakpointKind
	if bp.WatchType != 0 {
		kind = bp.WatchType.Size()
	}
	return p.conn.clearBreakpoint(bp.Addr, watchTypeToBreakpointType(bp.WatchType), kind)
}

// FollowExec enables (or disables) follow exec mode
func (p *gdbProcess) FollowExec(bool) error {
	return errors.New("follow exec not supported")
}

type threadUpdater struct {
	p    *gdbProcess
	seen map[int]bool
	done bool
}

func (tu *threadUpdater) Reset() {
	tu.done = false
	tu.seen = nil
}

func (tu *threadUpdater) Add(threads []string) error {
	if tu.done {
		panic("threadUpdater: Add after Finish")
	}
	if tu.seen == nil {

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Use the native backend (dlv debug/exec --backend=native) where follow-exec is implemented.
  2. Disable follow-exec mode; debug the child process directly by attaching to it after it execs.
  3. Re-run the program under delve with the child entrypoint as the main target.
  4. Check delve release notes; support may be backend-limited indefinitely.

Example fix

// before
dlv --backend=lldb exec ./app   // then enable follow-exec
// after
dlv --backend=native exec ./app // follow-exec supported
Defensive patterns

Strategy: fallback

Validate before calling

if _, ok := p.(*gdbserial.gdbProcess); ok {
    return errors.New("follow exec requires the native backend")
}

Try / catch

if err := p.FollowExec(true); err != nil {
    // fall back: attach to child manually after exec
}

Prevention

When it happens

Trigger: Calling gdbProcess.FollowExec(true) (e.g. via the debugger's follow-exec toggle) on any session using the gdbserial backend (lldb/rr).

Common situations: Enabling follow-exec mode in delve while connected via 'dlv connect' to an lldb-server or during rr replay.

Related errors


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/74ad5d59e32e0e21. Report an issue: GitHub.