{"record":{"id":"9fe9195cb557565b","repo":"go-delve/delve","slug":"map-type-not-yet-supported-by-ebpf-tracing","errorCode":null,"errorMessage":"map type not yet supported by ebpf tracing","messagePattern":"map type not yet supported by ebpf tracing","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/proc/internal/ebpf/helpers.go","lineNumber":565,"sourceCode":"\tcase reflect.Pointer, reflect.UnsafePointer:\n\t\tiparam.Kind = reflect.Uintptr\n\t\tiparam.RealType = &godwarf.UintType{BasicType: godwarf.BasicType{CommonType: godwarf.CommonType{ByteSize: vs, ReflectKind: reflect.Uintptr}}}\n\tcase reflect.Slice:\n\t\tiparam.Kind = reflect.Uintptr\n\t\tiparam.RealType = &godwarf.UintType{BasicType: godwarf.BasicType{CommonType: godwarf.CommonType{ByteSize: 8, ReflectKind: reflect.Uintptr}}}\n\tcase reflect.String:\n\t\tif len(iparam.Data) >= 16 {\n\t\t\tiparam.Base = fakeAddressUnresolv + uint64(valSize)\n\t\t\tiparam.Len = int64(binary.LittleEndian.Uint64(iparam.Data[8:16]))\n\t\t}\n\t\tiparam.RealType = &godwarf.StringType{\n\t\t\tStructType: godwarf.StructType{\n\t\t\t\tCommonType: godwarf.CommonType{ByteSize: 16, ReflectKind: reflect.String},\n\t\t\t\tKind:       \"struct\",\n\t\t\t},\n\t\t}\n\tcase reflect.Map:\n\t\tiparam.Unreadable = fmt.Errorf(\"map type not yet supported by ebpf tracing\")\n\tcase reflect.Chan:\n\t\tiparam.Unreadable = fmt.Errorf(\"chan type not yet supported by ebpf tracing\")\n\tcase reflect.Interface:\n\t\tiparam.Unreadable = fmt.Errorf(\"interface type not yet supported by ebpf tracing\")\n\tcase reflect.Func:\n\t\tiparam.Unreadable = fmt.Errorf(\"func type not yet supported by ebpf tracing\")\n\tcase reflect.Struct:\n\t\tiparam.Unreadable = fmt.Errorf(\"struct type not yet supported by ebpf tracing without DWARF type\")\n\tcase reflect.Array:\n\t\tiparam.Unreadable = fmt.Errorf(\"array type not yet supported by ebpf tracing without DWARF type\")\n\tdefault:\n\t\tiparam.Unreadable = fmt.Errorf(\"unrecognized reflect.Kind %d from eBPF\", iparam.Kind)\n\t}\n}\n\nfunc createFunctionParameterList(entry uint64, goidOffset int64, args []UProbeArgMap, isret bool) function_parameter_list_t {\n\tvar params function_parameter_list_t\n\tparams.goid_offset = uint32(goidOffset)","sourceCodeStart":547,"sourceCodeEnd":583,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/internal/ebpf/helpers.go#L547-L583","documentation":"synthesizeTypeFromKind is the fallback that builds a synthetic godwarf type from the reflect.Kind recorded in the eBPF UProbeArgMap when no full DWARF type is available. Map parameters cannot be reconstructed from raw bytes this way, so instead of synthesizing a type the code marks the parameter Unreadable with this error. The tracepoint event still arrives, but this argument's value cannot be displayed.","triggerScenarios":"Tracing a function whose parameter (or return value) is a map, when the UProbeArgMap carries only the reflect.Kind (no resolvable DWARF type); handleParamEvent then calls synthesizeTypeFromKind, which hits 'case reflect.Map'.","commonSituations":"Running 'dlv trace --ebpf' on a function that takes a map argument (e.g. func f(m map[string]int)); tracing via the eBPF backend on stripped binaries or older pipelines where DWARF type resolution for the argument failed.","solutions":["Avoid tracing functions with map-typed parameters via eBPF, or wrap the call so the map is not a traced argument.","Ensure the target binary retains full DWARF info (build without -w/-s, no strip) so breakpoints.go can resolve the argument's real DWARF type instead of falling back to Kind-only synthesis.","Read other arguments of the event; only this parameter is marked Unreadable — handle the Unreadable error when displaying the variable.","Follow delve releases; map support may be added to the eBPF type pipeline later."],"exampleFix":"// before\ndlv trace --ebpf mypkg.(*Cache).Update   // Update(m map[string]int)\n// parameter shows: map type not yet supported by ebpf tracing\n// after\n// trace a wrapper exposing scalar fields instead:\nfunc (c *Cache) UpdateSize() int { return len(c.m) }\ndlv trace --ebpf mypkg.(*Cache).UpdateSize","handlingStrategy":"type-guard","validationCode":"// Check the function's signature before tracing it with eBPF:\nfunc hasUnsupportedParams(fn *proc.Function, bi *proc.BinaryInfo) bool {\n\tfor _, p := range parameterTypes(fn, bi) {\n\t\tif p == nil {\n\t\t\treturn true // unresolvable type will hit the Kind-only fallback\n\t\t}\n\t\tk := p.Common().ReflectKind\n\t\tif k == reflect.Map || k == reflect.Chan || k == reflect.Interface || k == reflect.Func || k == reflect.Struct || k == reflect.Array {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}","typeGuard":"func isEBPFSupportedKind(k reflect.Kind) bool {\n\tswitch k {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,\n\t\treflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr,\n\t\treflect.Bool, reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128,\n\t\treflect.Pointer, reflect.UnsafePointer, reflect.Slice, reflect.String:\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":"for _, p := range traceEvent.InputParams {\n\tif p.Unreadable != nil {\n\t\tif strings.Contains(p.Unreadable.Error(), \"map type not yet supported\") {\n\t\t\tfmt.Printf(\"param %s: <unsupported: map>\\n\", p.Name)\n\t\t\tcontinue\n\t\t}\n\t\treturn p.Unreadable\n\t}\n\tloadAndPrint(p)\n}","preventionTips":["Check the target function's parameter types before attaching eBPF tracepoints; supported kinds are int/uint/bool/float/complex/string/pointer/slice.","Always build the traced binary with full DWARF info (never -w/-s or stripped) so the DWARF-typed path is used instead of the Kind-only fallback.","When consuming trace events, always check RawUProbeParam.Unreadable before calling loadValue on the parameter.","Prefer tracing scalar-argument wrappers over map/chan/interface/func-taking functions with the eBPF backend."],"tags":["ebpf","tracing","unsupported-type","reflect"],"backgroundTag":"ebpf-unsupported-arg-type","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}