go-delve/delve · warning

follow exec not implemented

Error message

follow exec not implemented

What it means

FollowExec mode (automatically attaching to child processes after exec) is not implemented on this platform's native backend. The stub returns this error unconditionally, so the feature simply cannot be enabled here.

Source

Thrown at pkg/proc/native/followexec_other.go:9

//go:build !linux && !windows

package native

import "errors"

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

func (*processGroup) detachChild(*nativeProcess) error {
	panic("not implemented")
}

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Do not call FollowExec on this platform; check platform support first
  2. Use dlv's exec-based workflow manually: let the child run separately and attach with dlv attach <pid>
  3. If Linux support is needed, run the debugger with the native Linux backend where follow exec is implemented
  4. File/check an upstream issue if you need follow-exec on your OS

Example fix

// before
dbg.FollowExec(true)
// after
if runtime.GOOS == "linux" {
    dbg.FollowExec(true)
} else {
    log.Println("follow exec not supported on", runtime.GOOS)
}
Defensive patterns

Strategy: fallback

Validate before calling

// gate follow-exec on platform support before calling
var followExecSupported = runtime.GOOS == "linux"
if !followExecSupported {
    return errors.New("follow exec is only supported on linux")
}

Try / catch

if err := dbg.FollowExec(true); err != nil {
    if strings.Contains(err.Error(), "follow exec not implemented") {
        log.Println("follow-exec unavailable; falling back to manual attach")
    } else {
        return err
    }
}

Prevention

When it happens

Trigger: Calling (*nativeProcess).FollowExec(true or false) on any platform compiled with followexec_other.go (i.e., not linux with the follow-exec implementation), e.g. via debugger.FollowExec on macOS or FreeBSD.

Common situations: User enables follow-exec-mode in the Delve config on a non-Linux OS; CLI/API user toggles follow exec while debugging on macOS/Windows/FreeBSD native backend.

Related errors


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