{"record":{"id":"fd2da72eca7e40ac","repo":"go-delve/delve","slug":"too-many-arguments","errorCode":null,"errorMessage":"too many arguments","messagePattern":"too many arguments","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/fncall.go","lineNumber":65,"sourceCode":"//\n// 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","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/fncall.go#L47-L83","documentation":"Delve throws this when a function call expression passes more arguments than the target Go function accepts. During call injection Delve evaluates each argument expression and maps it onto the callee's formal parameters read from DWARF; if the argument count exceeds the formal (or variadic-adjusted) arity, injection is aborted before touching the target process.","triggerScenarios":"`call f(a, b, c)` where f has only 2 parameters; calling a non-variadic function with extra arguments from the debugger prompt.","commonSituations":"Typo in arity while calling from the dlv terminal; calling a wrapper function thinking it forwards all args; API changed signature (arg removed) and the user's call is stale.","solutions":["Remove the extra arguments to match the function's signature","Check the signature with `print f` or inspect the source before calling","If extra values were meant for a variadic call, call the function that is actually variadic","If the signature changed, update the call to the new arity"],"exampleFix":"// before\n(dlv) call add(1, 2, 3) // add takes two params\n// after\n(dlv) call add(1, 2)","handlingStrategy":"validation","validationCode":"// verify arity before issuing the call\n(dlv) print add // inspect signature\n// only call with exactly len(formalArgs) arguments","typeGuard":null,"tryCatchPattern":"if err := scope.CallFunction(expr); err != nil && err.Error() == \"too many arguments\" {\n    // fix arity in expr and retry\n}","preventionTips":["Check the function signature before each injected call","Update stale call expressions after signature changes","Remember Go has no default arguments","Use editor/LSP to confirm param count"],"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"}