go-delve/delve · warning

unknown or unsupported kind: %q

Error message

unknown or unsupported kind: %q

What it means

During `loadValue`, the variable's `reflect.Kind` was not one of the kinds Delve knows how to display (numbers, strings, structs, maps, chans, funcs, etc.). The value is marked unreadable with this error instead of being loaded. This indicates either a Delve gap or a corrupted/unsupported type.

Source

Thrown at pkg/proc/variables.go:1491

		if err == nil {
			v.Value = constant.MakeBool(val[0] != 0)
		}
	case reflect.Float32, reflect.Float64:
		var val float64
		val, v.Unreadable = v.readFloatRaw(v.RealType.(*godwarf.FloatType).ByteSize)
		v.Value = constant.MakeFloat64(val)
		switch {
		case math.IsInf(val, +1):
			v.FloatSpecial = FloatIsPosInf
		case math.IsInf(val, -1):
			v.FloatSpecial = FloatIsNegInf
		case math.IsNaN(val):
			v.FloatSpecial = FloatIsNaN
		}
	case reflect.Func:
		v.loadFunctionPtr(recurseLevel, cfg)
	default:
		v.Unreadable = fmt.Errorf("unknown or unsupported kind: %q", v.Kind.String())
	}
}

// convertToEface converts srcv into an "interface {}" and writes it to
// dstv.
// Dstv must be a variable of type "interface {}" and srcv must either be an
// interface or a pointer shaped variable (map, channel, pointer or struct
// containing a single pointer)
func convertToEface(srcv, dstv *Variable) error {
	if dstv.RealType.String() != "interface {}" {
		return &typeConvErr{srcv.DwarfType, dstv.RealType}
	}
	if _, isiface := srcv.RealType.(*godwarf.InterfaceType); isiface {
		// iface -> eface conversion
		_type, data, _ := srcv.readInterface()
		if srcv.Unreadable != nil {
			return srcv.Unreadable
		}

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Upgrade to the latest Delve release; support for kinds is added over time.
  2. Cast or reinterpret the value into a supported type, e.g. view the underlying memory as a struct or uintptr.
  3. Inspect the type with `print` on a narrower sub-expression (e.g. individual fields).
  4. If reproducible on a normal Go type, file a Delve issue with the type and Go version.
Defensive patterns

Strategy: fallback

Validate before calling

// (dlv) print reflect.TypeOf-like inspection: print the variable alone
// and check the displayed type before deep evaluation.

Try / catch

// In RPC2 clients, check the returned Variable.Unreadable field:
if strings.Contains(v.Unreadable.Error(), "unknown or unsupported kind") {
    // fall back to raw memory inspection
}

Prevention

When it happens

Trigger: Evaluating a variable whose resolved DWARF type maps to an unsupported reflect.Kind in `Variable.loadValue`; may be hit via CLI print, RPC2 EvalVariable, or DAP evaluate on exotic types.

Common situations: Debugging types produced by unsafe casts or cgo where the DWARF type resolves to an odd kind; Delve version lag on newly added runtime types; corrupted binary info making kind resolution produce Invalid/unsupported kinds.

Related errors


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