go-delve/delve · error

you must provide a core file and an executable

Error message

you must provide a core file and an executable

What it means

Error "you must provide a core file and an executable" thrown in go-delve/delve.

Source

Thrown at cmd/dlv/cmds/commands.go:388

	traceCommand.Flags().String("output", "", "Output path for the binary.")
	must(traceCommand.MarkFlagFilename("output"))
	traceCommand.Flags().IntVarP(&traceFollowCalls, "follow-calls", "", 0, "Trace all children of the function to the required depth. Trace also supports defer functions and cases where functions are dynamically returned and passed as parameters.")
	traceCommand.Flags().IntVarP(&traceVerbose, "verbose", "v", 0, "Parameter verbosity: 0=values, 1=types, 2=inline, 3=expanded, 4=full (default 0)")
	rootCommand.AddCommand(traceCommand)

	coreCommand := &cobra.Command{
		Use:   "core <executable> <core>",
		Short: "Examine a core dump.",
		Long: `Examine a core dump (only supports linux and windows core dumps).

The core command will open the specified core file and the associated
executable and let you examine the state of the process when the
core dump was taken.

Currently supports linux/amd64 and linux/arm64 core files, windows/amd64 minidumps and core files generated by Delve's 'dump' command.`,
		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
			if len(args) != 2 {
				return errors.New("you must provide a core file and an executable")
			}
			return nil
		},
		Run: coreCmd,
		ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
			if len(args) > 2 {
				return nil, cobra.ShellCompDirectiveNoFileComp
			}
			return nil, cobra.ShellCompDirectiveDefault
		},
	}
	// -c is unused and exists so delve can be used with coredumpctl
	core := false
	coreCommand.Flags().BoolVarP(&core, "core", "c", false, "")
	coreCommand.Flags().MarkHidden("core")
	rootCommand.AddCommand(coreCommand)

	// 'version' subcommand.

View on GitHub (pinned to a23773e6c3)

When it happens

Trigger: Thrown at cmd/dlv/cmds/commands.go:388 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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