{"record":{"id":"e5702d14bdb547a9","repo":"go-delve/delve","slug":"could-not-find-die-for-function-q","errorCode":null,"errorMessage":"could not find DIE for function %q","messagePattern":"could not find DIE for function %q","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/fncall.go","lineNumber":523,"sourceCode":"// funcCallEvalFuncExpr evaluates expr.Fun and returns the function that we're trying to call.\n// If allowCalls is false function calls will be disabled even if scope.callCtx != nil\nfunc funcCallEvalFuncExpr(scope *EvalScope, stack *evalStack, fncall *functionCallState) error {\n\tbi := scope.BinInfo\n\n\tfnvar := stack.peek()\n\tif fnvar.Kind != reflect.Func {\n\t\treturn fmt.Errorf(\"expression %q is not a function\", astutil.ExprToString(fncall.expr.Fun))\n\t}\n\tfnvar.loadValue(LoadConfig{false, 0, 0, 0, 0, 0})\n\tif fnvar.Unreadable != nil {\n\t\treturn fnvar.Unreadable\n\t}\n\tif fnvar.Base == 0 {\n\t\treturn errors.New(\"nil pointer dereference\")\n\t}\n\tfncall.fn = bi.PCToFunc(fnvar.Base)\n\tif fncall.fn == nil {\n\t\treturn fmt.Errorf(\"could not find DIE for function %q\", astutil.ExprToString(fncall.expr.Fun))\n\t}\n\tif !fncall.fn.cu.isgo {\n\t\treturn errNotAGoFunction\n\t}\n\tfncall.closureAddr = fnvar.closureAddr\n\n\tvar err error\n\tfncall.argFrameSize, fncall.formalArgs, err = funcCallArgs(fncall.fn, bi, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\targnum := len(fncall.expr.Args)\n\n\t// If the function variable has a child then that child is the method\n\t// receiver. However, if the method receiver is not being used (e.g.\n\t// func (_ X) Foo()) then it will not actually be listed as a formal\n\t// argument. Ensure that we are really off by 1 to add the receiver to","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/fncall.go#L505-L541","documentation":"After evaluating the function expression, Delve uses PCToFunc to map the function's code address back to a Function (DIE) in the debug info. If the base address doesn't correspond to any known function, this error is returned, meaning the debug info lacks the entry for the target.","triggerScenarios":"Calling a function whose address comes from a func-valued variable but whose code region is not covered by the loaded DWARF info, e.g. an assembly function, a symbol from a stripped shared library, or a corrupted fn.Base.","commonSituations":"Calling into cgo/assembly code; binary rebuilt (stale symbols) while debugger attached; calling function pointers into runtime/assembly stubs without DWARF entries.","solutions":["Rebuild the binary with full debug info (-gcflags=all=\"-N -l\") and restart the debug session","Avoid calling assembly or cgo functions via call injection","Check that the loaded binary matches the running process"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if dbg.BinInfo().PCToFunc(fnvar.Base) == nil {\n    return errors.New(\"target function has no debug info; rebuild with -gcflags=all=\\\"-N -l\\\"\")\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"could not find DIE\") {\n    // fall back to breakpoints/stepping instead of call injection\n}","preventionTips":["Always debug the exact binary you built, unstripped","Avoid calling assembly, cgo, or runtime stubs via call injection"],"tags":["go","debugger","dwarf","call-injection"],"backgroundTag":"missing-debug-info","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}