{"record":{"id":"ac34fbe2f671b8fd","repo":"go-delve/delve","slug":"not-enough-arguments","errorCode":null,"errorMessage":"not enough arguments","messagePattern":"not enough arguments","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/fncall.go","lineNumber":66,"sourceCode":"// When the target has runtime.debugPinner then evalCallInjectionPinPointer\n// must be also called in a loop until it returns false.\n\nconst (\n\tdebugCallFunctionNamePrefix1 = \"debugCall\"\n\tdebugCallFunctionNamePrefix2 = \"runtime.debugCall\"\n\tmaxDebugCallVersion          = 2\n\tmaxArgFrameSize              = 65535\n)\n\nvar (\n\terrFuncCallUnsupported        = errors.New(\"function calls not supported by this version of Go\")\n\terrFuncCallUnsupportedBackend = errors.New(\"backend does not support function calls\")\n\terrFuncCallInProgress         = errors.New(\"cannot call function while another function call is already in progress\")\n\terrNoGoroutine                = errors.New(\"no goroutine selected\")\n\terrGoroutineNotRunning        = errors.New(\"selected goroutine not running\")\n\terrNotEnoughStack             = errors.New(\"not enough stack space\")\n\terrTooManyArguments           = errors.New(\"too many arguments\")\n\terrNotEnoughArguments         = errors.New(\"not enough arguments\")\n\terrNotAGoFunction             = errors.New(\"not a Go function\")\n\terrFuncCallNotAllowedStrAlloc = errors.New(\"literal string can not be allocated because function calls are not allowed without using 'call'\")\n)\n\ntype functionCallState struct {\n\t// savedRegs contains the saved registers\n\tsavedRegs Registers\n\t// err contains a saved error\n\terr error\n\t// expr is the expression being evaluated\n\texpr *ast.CallExpr\n\t// fn is the function that is being called\n\tfn *Function\n\t// receiver is the receiver argument for the function\n\treceiver *Variable\n\t// closureAddr is the address of the closure being called\n\tclosureAddr uint64\n\t// formalArgs are the formal arguments of fn","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/fncall.go#L48-L84","documentation":"Delve throws this when a function call expression provides fewer arguments than the target function requires. Call injection must set up every formal parameter before transferring control; missing arguments leave the argument area incomplete, so Delve rejects the call before injection.","triggerScenarios":"`call f(a)` where f requires 2 parameters; omitting arguments that have no default (Go has no default arguments); calling a method without accounting for the receiver.","commonSituations":"Porting a call from an older signature that had fewer parameters; forgetting a variadic argument list; hand-writing calls in the dlv REPL against a remembered signature.","solutions":["Supply all required arguments in the call expression","Check the exact signature via `print <fn>` or editor before calling","Bind values from the current scope (locals are valid argument expressions)","If you only need the value, use `print f(args)` after fixing args, or drop the call"],"exampleFix":"// before\n(dlv) call add(1)\n// after\n(dlv) call add(1, 2)","handlingStrategy":"validation","validationCode":"// count args before calling\n(dlv) print add\n// supply every formal argument in the call expression","typeGuard":null,"tryCatchPattern":"if err := scope.CallFunction(expr); err != nil && err.Error() == \"not enough arguments\" {\n    // complete the argument list and retry\n}","preventionTips":["Supply all required parameters in call expressions","Verify the current signature (it may have gained params)","Do not rely on defaults; Go has none","Account for method receivers when reading arity"],"tags":["debugger","function-call-injection","arguments"],"backgroundTag":"argument-count-mismatch","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}