{"record":{"id":"091d36e18306a117","repo":"go-delve/delve","slug":"could-not-find-symbol-value-for-s-091d36","errorCode":null,"errorMessage":"could not find symbol value for %s","messagePattern":"could not find symbol value for (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/evalop/evalcompile.go","lineNumber":539,"sourceCode":"\t}\n\n\tswitch n := fnnode.(type) {\n\tcase *ast.BasicLit:\n\t\t// It can only be a (\"type string\")(x) type cast\n\t\treturn ctx.compileTypeCast(node, nil)\n\tcase *ast.ArrayType, *ast.StructType, *ast.FuncType, *ast.InterfaceType, *ast.MapType, *ast.ChanType:\n\t\treturn ctx.compileTypeCast(node, nil)\n\tcase *ast.SelectorExpr:\n\t\tif _, isident := n.X.(*ast.Ident); isident {\n\t\t\tif typ, _ := ctx.FindTypeExpr(n); typ != nil {\n\t\t\t\treturn ctx.compileTypeCast(node, nil)\n\t\t\t}\n\t\t\treturn ambiguous()\n\t\t}\n\t\treturn ctx.compileFunctionCall(node, toplevel)\n\tcase *ast.Ident:\n\t\tif typ, _ := ctx.FindTypeExpr(n); typ != nil {\n\t\t\treturn ctx.compileTypeCast(node, fmt.Errorf(\"could not find symbol value for %s\", n.Name))\n\t\t}\n\t\treturn ctx.compileFunctionCall(node, toplevel)\n\tcase *ast.IndexExpr:\n\t\t// Ambiguous, could be a parametric type\n\t\tswitch n.X.(type) {\n\t\tcase *ast.Ident, *ast.SelectorExpr:\n\t\t\t// Do the type-cast first since evaluating node.Fun could be expensive.\n\t\t\terr := ctx.compileTypeCast(node, nil)\n\t\t\tif err == nil || err != reader.ErrTypeNotFound {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn ctx.compileFunctionCall(node, toplevel)\n\t\tdefault:\n\t\t\treturn ctx.compileFunctionCall(node, toplevel)\n\t\t}\n\tcase *ast.IndexListExpr:\n\t\treturn ctx.compileTypeCast(node, nil)\n\tdefault:","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/evalop/evalcompile.go#L521-L557","documentation":"In compileTypeCastOrFuncCall, when the callee is a plain identifier that is neither a known function nor a resolvable type, Delve checks if it resolves as a type (FindTypeExpr); if not, it produces 'could not find symbol value for <name>' as the fallback error for a failed type cast. This means the identifier could not be resolved to any symbol, function, or type visible at the current location.","triggerScenarios":"Calling or casting an unknown identifier, e.g. 'call foo()' where foo is not in scope, or a type conversion like 'T(x)' where T is not a visible type/symbol. Also occurs when the identifier is shadowed, stripped by the compiler (inlined away), or belongs to a package not imported into the current frame.","commonSituations":"Typo in a function/variable/type name at the (dlv) prompt; referring to a symbol optimized out or inlined; using a type from a package whose DWARF info isn't loaded (stripped binaries); generics/parametric types partially matching.","solutions":["Check spelling and scope: switch to the frame where the symbol is in scope ('frame N') or qualify with a package name ('main.myFunc')","Verify the binary was built with optimizations that didn't eliminate the symbol (use -gcflags='all=-N -l')","If it is a type cast, ensure the type name is fully qualified and present in DWARF (not a stripped binary)","Use 'locals'/'vars'/'funcs <name>' to confirm the symbol exists before calling it"],"exampleFix":"// before\n(dlv) call procsess(x) // typo\n// after\n(dlv) funcs procsess   // verify name\n(dlv) call process(x)","handlingStrategy":"validation","validationCode":"// At the REPL: confirm the symbol exists before calling\n// (dlv) funcs myFunc\n// (dlv) locals\n// In tooling: check the identifier against known function/variable lists first.","typeGuard":"null","tryCatchPattern":"// Wrap evaluation and surface a scope-check hint\nres, err := eval(expr)\nif err != nil && strings.Contains(err.Error(), \"could not find symbol value for\") {\n\treturn fmt.Errorf(\"%w: run 'funcs'/'locals' to verify the symbol is in scope\", err)\n}","preventionTips":["Build with -gcflags='all=-N -l' to keep symbols alive","Qualify package-level symbols (pkg.Func)","Switch to the correct frame before evaluating"],"tags":["debugger","symbol-lookup","expression-evaluation"],"backgroundTag":"symbol-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}