{"record":{"id":"c145b4437581fab3","repo":"go-delve/delve","slug":"no-fde-for-uprobe-pc-x-w","errorCode":null,"errorMessage":"no FDE for uprobe PC %#x: %w","messagePattern":"no FDE for uprobe PC %#x: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/breakpoints.go","lineNumber":706,"sourceCode":"\n\t// Finally, set the uprobe on the function.\n\treturn t.proc.SetUProbe(fn.Name, goidOffset, args)\n}\n\n// uprobeEntryPointCFA returns the uprobe PC (FirstPCAfterPrologue) and\n// the CFA-from-RSP offset at that PC (i.e. the constant N in CFA = RSP + N).\n// This offset is used as inputRegs.CFA when evaluating DWARF locations for\n// input parameters so that DW_OP_fbreg expressions yield RSP-relative offsets\n// directly — see the comment in setEBPFTracepointOnFunc for the full derivation.\nfunc uprobeEntryPointCFA(t *Target, fn *Function) (uint64, int64, error) {\n\tuprobePC, err := FirstPCAfterPrologue(t, fn, false)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tbi := t.BinInfo()\n\tfde, err := bi.frameEntries.FDEForPC(uprobePC)\n\tif err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"no FDE for uprobe PC %#x: %w\", uprobePC, err)\n\t}\n\tframectx, err := fde.EstablishFrame(uprobePC)\n\tif err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"cannot establish frame at uprobe PC %#x: %w\", uprobePC, err)\n\t}\n\tif framectx.CFA.Rule != frame.RuleCFA {\n\t\treturn 0, 0, fmt.Errorf(\"unexpected CFA rule %d at uprobe PC %#x\", framectx.CFA.Rule, uprobePC)\n\t}\n\treturn uprobePC, framectx.CFA.Offset, nil\n}\n\n// SetWatchpoint sets a data breakpoint at addr and stores it in the\n// process wide break point table.\nfunc (t *Target) SetWatchpoint(logicalID int, scope *EvalScope, expr string, wtype WatchType, cond ast.Expr) (*Breakpoint, error) {\n\tif (wtype&WatchWrite == 0) && (wtype&WatchRead == 0) {\n\t\treturn nil, errors.New(\"at least one of read and write must be set for watchpoint\")\n\t}\n","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/breakpoints.go#L688-L724","documentation":"Before setting an eBPF uprobe, Delve computes the CFA (canonical frame address) offset from the binary's DWARF frame table. FDEForPC returned an error, meaning no Frame Description Entry covers the uprobe PC, so the frame layout cannot be determined and the tracepoint cannot be set.","triggerScenarios":"Calling setEBPFTracepointOnFunc (e.g. 'dlv trace' with --ebpf) on a function whose chosen uprobe PC (from FirstPCAfterPrologue or fn.Entry) falls in a code region without DWARF CFI, such as hand-written assembly, generated thunks, or code compiled without -funwind-tables.","commonSituations":"Tracing runtime/assembly functions (e.g. runtime.duffzero, runtime.morestack) with the eBPF backend; binaries stripped of .eh_frame/.debug_frame; cross-compiled binaries missing frame sections.","solutions":["Trace a normal Go function with DWARF unwind info instead of an assembly/runtime function","Rebuild the binary keeping frame and debug info (default go build flags; avoid -ldflags '-s -w' and don't strip the binary)","Use the non-eBPF trace backend (dlv trace without --ebpf) which does not need CFI","Inspect the wrapped error to confirm which PC lacks an FDE and whether the binary has .debug_frame"],"exampleFix":"// before\ndlv trace --ebpf runtime.duffzero\n// after\ndlv trace --ebpf mypkg.MyFunc","handlingStrategy":"fallback","validationCode":"bi := t.BinInfo()\nif _, err := bi.frameEntries.FDEForPC(fn.Entry); err != nil { /* choose non-eBPF backend */ }","typeGuard":null,"tryCatchPattern":"pc, cfa, err := uprobeEntryPointCFA(t, uprobePC)\nif err != nil && strings.Contains(err.Error(), \"no FDE for uprobe PC\") {\n    return setSoftwareTracepoint(t, fn) // fallback backend\n}","preventionTips":["Avoid --ebpf tracing for assembly and runtime functions","Verify the binary contains .debug_frame/.eh_frame (readelf -S) before enabling eBPF tracing","Don't strip or -s -w the target binary","Prefer FirstPCAfterPrologue over fn.Entry for uprobe placement"],"tags":["ebpf","dwarf","unwind","breakpoints"],"backgroundTag":"missing-fde-for-pc","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}