{"record":{"id":"871ff8c84f12d5d9","repo":"go-delve/delve","slug":"unknown-register","errorCode":null,"errorMessage":"unknown register","messagePattern":"unknown register","errorType":"exception","errorClass":"ErrUnknownRegister","httpStatus":null,"severity":"warning","filePath":"pkg/proc/registers.go","lineNumber":50,"sourceCode":"\tName string\n\tReg  *op.DwarfRegister\n}\n\n// AppendUint64Register will create a new Register struct with the name and value\n// specified and append it to the `regs` slice.\nfunc AppendUint64Register(regs []Register, name string, value uint64) []Register {\n\treturn append(regs, Register{name, op.DwarfRegisterFromUint64(value)})\n}\n\n// AppendBytesRegister will create a new Register struct with the name and value\n// specified and append it to the `regs` slice.\nfunc AppendBytesRegister(regs []Register, name string, value []byte) []Register {\n\treturn append(regs, Register{name, op.DwarfRegisterFromBytes(value)})\n}\n\n// ErrUnknownRegister is returned when the value of an unknown\n// register is requested.\nvar ErrUnknownRegister = errors.New(\"unknown register\")\n\ntype flagRegisterDescr []flagDescr\ntype flagDescr struct {\n\tname string\n\tmask uint64\n}\n\nvar mxcsrDescription flagRegisterDescr = []flagDescr{\n\t{\"FZ\", 1 << 15},\n\t{\"RZ/RN\", 1<<14 | 1<<13},\n\t{\"PM\", 1 << 12},\n\t{\"UM\", 1 << 11},\n\t{\"OM\", 1 << 10},\n\t{\"ZM\", 1 << 9},\n\t{\"DM\", 1 << 8},\n\t{\"IM\", 1 << 7},\n\t{\"DAZ\", 1 << 6},\n\t{\"PE\", 1 << 5},","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/registers.go#L32-L68","documentation":"ErrUnknownRegister is returned when a register is requested by name that the architecture's register set does not define. GetReg/Get (and DWARF register name resolution via getAsmRegister) look up names in the arch-specific register table and return this sentinel when the name is not present.","triggerScenarios":"Evaluating an expression that references a register name not valid for the target architecture (e.g. 'xmm0' on arm64, 'r15' on 386); RPC calls to GetReg with misspelled names; DWARF CFA/rules referencing registers the backend does not model.","commonSituations":"Scripts or IDE plugins hardcoding x86 register names while debugging arm64; cross-arch debugging sessions; using DWARF files that reference pseudo-registers the backend lacks.","solutions":["Use a register name valid for the target architecture (list them via the appropriate regs/API for the arch)","Fix the register name spelling and case in your script/command","Check runtime.GOARCH of the debugged binary before naming registers"],"exampleFix":"// before\nval, err := regs.Get(\"eax\") // on arm64\n// after\nval, err := regs.Get(\"x0\") // arch-appropriate register name","handlingStrategy":"validation","validationCode":"// check arch before naming registers\nvar reg string\nswitch runtime.GOARCH {\ncase \"arm64\":\n    reg = \"x0\"\ncase \"amd64\":\n    reg = \"rax\"\ncase \"386\":\n    reg = \"eax\"\n}","typeGuard":null,"tryCatchPattern":"val, err := regs.Get(name)\nif errors.Is(err, proc.ErrUnknownRegister) {\n    return fmt.Errorf(\"register %q not valid for %s\", name, runtime.GOARCH)\n}","preventionTips":["Derive register names from runtime.GOARCH instead of hardcoding","Consult the arch register list in pkg/proc/<arch>regs before scripting","Trim/normalize user-provided register names"],"tags":["registers","architecture","dwarf"],"backgroundTag":"unknown-register","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}