{"record":{"id":"458f6c5fb0610496","repo":"go-delve/delve","slug":"not-implemented-458f6c","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/fncall.go","lineNumber":501,"sourceCode":"\tcase \"amd64\":\n\t\tsp := regs.SP()\n\t\t// push PC on the stack\n\t\tsp -= uint64(bi.Arch.PtrSize())\n\t\tif err := setSP(thread, sp); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := writePointer(bi, thread.ProcessMemory(), sp, regs.PC()); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn setPC(thread, callAddr)\n\tcase \"arm64\", \"ppc64le\", \"loong64\":\n\t\tif err := setLR(thread, regs.PC()); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn setPC(thread, callAddr)\n\n\tdefault:\n\t\tpanic(\"not implemented\")\n\t}\n}\n\n// 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\")","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/fncall.go#L483-L519","documentation":"callOP sets up a function call injection on a thread for a given calling convention. The default case — reached when bininfo.Arch.Name is none of '386', 'amd64', 'arm64', 'ppc64le', 'loong64' (i.e. an architecture without call-injection support, such as riscv64) — panics 'not implemented'. Function calls from the debugger are inherently architecture-specific (register setup: args, stack alignment, LR/PC).","triggerScenarios":"evalCallInjectionStart / evalCallInjectionSetTarget invoking callOP with a thread whose architecture isn't one of the implemented ones — i.e. starting a function-call expression evaluation (print f(), eval -c ...) on an unsupported arch.","commonSituations":"Using function calls from the CLI or IDE on riscv64 or other freshly ported architectures; automated expression evaluation that inadvertently calls functions on unsupported targets.","solutions":["Only use function-call expressions on supported architectures (386, amd64, arm64, ppc64le, loong64)","Implement the missing arch case in callOP (argument registers, SP alignment, PC/LR) when porting call injection","Check Delve docs: function calls have per-architecture support; disable call injection (allowCalls=false) for unsupported arches"],"exampleFix":"// before\ndefault:\n\tpanic(\"not implemented\")\n// after\ndefault:\n\treturn fmt.Errorf(\"function call injection not implemented for %s\", bininfo.Arch.Name)","handlingStrategy":"validation","validationCode":"var callOPArches = map[string]bool{\"386\":true,\"amd64\":true,\"arm64\":true,\"ppc64le\":true,\"loong64\":true}\nif !callOPArches[bininfo.Arch.Name] {\n\treturn fmt.Errorf(\"function calls unsupported on %s\", bininfo.Arch.Name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict function-call evaluation to supported architectures before calling callOP","Set allowCalls=false on unsupported targets so expressions never inject calls","Add the arch's calling-convention code when porting Delve to new platforms"],"tags":["function-calls","architecture-support","fncall","panic"],"backgroundTag":"unsupported-architecture","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}