{"record":{"id":"b1b6189ff76131ab","repo":"go-delve/delve","slug":"wrong-argument-q-is-not-a-number","errorCode":null,"errorMessage":"wrong argument: %q is not a number","messagePattern":"wrong argument: %q is not a number","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/terminal/command.go","lineNumber":2653,"sourceCode":"\n\tvar disasm api.AsmInstructions\n\tvar disasmErr error\n\n\tswitch cmd {\n\tcase \"\":\n\t\tlocs, _, err := t.client.FindLocation(ctx.Scope, \"+0\", true, t.substitutePathRules())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdisasm, disasmErr = t.client.DisassemblePC(ctx.Scope, locs[0].PC, flavor)\n\tcase \"-a\":\n\t\tv := config.Split2PartsBySpace(rest)\n\t\tif len(v) != 2 {\n\t\t\treturn errDisasmUsage\n\t\t}\n\t\tstartpc, err := strconv.ParseInt(v[0], 0, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"wrong argument: %q is not a number\", v[0])\n\t\t}\n\t\tendpc, err := strconv.ParseInt(v[1], 0, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"wrong argument: %q is not a number\", v[1])\n\t\t}\n\t\tdisasm, disasmErr = t.client.DisassembleRange(ctx.Scope, uint64(startpc), uint64(endpc), flavor)\n\tcase \"-l\":\n\t\tlocs, _, err := t.client.FindLocation(ctx.Scope, rest, true, t.substitutePathRules())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(locs) != 1 {\n\t\t\treturn errors.New(\"expression specifies multiple locations\")\n\t\t}\n\t\tdisasm, disasmErr = t.client.DisassemblePC(ctx.Scope, locs[0].PC, flavor)\n\tdefault:\n\t\treturn errDisasmUsage\n\t}","sourceCodeStart":2635,"sourceCodeEnd":2671,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/terminal/command.go#L2635-L2671","documentation":"The `disass` command with a raw address range (`disass <startpc> <endpc>`) parses both arguments with strconv.ParseInt. If the first argument is not a valid integer (base auto-detected), the command returns this error without doing any work.","triggerScenarios":"Calling `disass` with two arguments where the first is not parseable as a number, e.g. `disass main.foo 0x401200` or `disass 0xZZ 0x400000`.","commonSituations":"Pasting a function name into the address-range form instead of using `-a`/`-l`; missing the `0x` prefix so a hex address fails to parse; copying an address with stray characters.","solutions":["Use the location form instead: `disass -l main.foo`","Prefix hex addresses with `0x`","Use `disass -a <function>` to disassemble a whole function"],"exampleFix":"// before\ndisass 401200 4012ff\n// after\ndisass 0x401200 0x4012ff","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if _, err := strconv.ParseInt(arg, 0, 64); err != nil {\n    return fmt.Errorf(\"%q is not a number; use disass -a <fn> or 0x-prefixed addresses\", arg)\n}","preventionTips":["Prefer disass -a/-l forms in scripts to avoid numeric parsing entirely"],"tags":["terminal","disassembly","argument-parsing"],"backgroundTag":"invalid-numeric-argument","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}