{"record":{"id":"a2be80d5191f99f1","repo":"go-delve/delve","slug":"not-valid-a2be80","errorCode":null,"errorMessage":"not valid","messagePattern":"not valid","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/linutil/regs_i386_arch.go","lineNumber":110,"sourceCode":"}\n\nfunc (r *I386Registers) BP() uint64 {\n\treturn uint64(uint32(r.Regs.Ebp))\n}\n\n// CX returns the value of ECX register.\nfunc (r *I386Registers) CX() uint64 {\n\treturn uint64(uint32(r.Regs.Ecx))\n}\n\n// TLS returns the address of the thread local storage memory segment.\nfunc (r *I386Registers) TLS() uint64 {\n\treturn r.Tls\n}\n\n// LR returns the link register.\nfunc (r *I386Registers) LR() uint64 {\n\tpanic(\"not valid\")\n}\n\n// GAddr returns the address of the G variable if it is known, 0 and false\n// otherwise.\nfunc (r *I386Registers) GAddr() (uint64, bool) {\n\treturn 0, false\n}\n\n// Copy returns a copy of these registers that is guaranteed not to change.\nfunc (r *I386Registers) Copy() (proc.Registers, error) {\n\tif r.loadFpRegs != nil {\n\t\terr := r.loadFpRegs(r)\n\t\tr.loadFpRegs = nil\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tvar rr I386Registers","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/linutil/regs_i386_arch.go#L92-L128","documentation":"The i386 (32-bit x86) ABI likewise has no dedicated link register, so I386Registers.LR() always panics. LR exists in the proc.Registers interface only for architectures that actually implement one (e.g. ARM64).","triggerScenarios":"Calling registers.LR() on an I386Registers value from stack-walking or frame-inspection code that does not account for GOARCH=386.","commonSituations":"Cross-architecture debugging tools assuming RISC semantics; generic code over pkg/proc registers interfaces; testing delve on 32-bit x86 Linux.","solutions":["Avoid LR() on i386; derive return addresses from the stack (CFA) instead","Branch on runtime.GOARCH before querying the link register","Use delve's existing frame/unwind helpers, which are architecture-aware"],"exampleFix":"// before\nret := regs.LR()\n// after\nif runtime.GOARCH == \"386\" {\n    ret = readReturnAddrFromStack(...)\n} else if hasLinkRegister {\n    ret = regs.LR()\n}","handlingStrategy":"type-guard","validationCode":"if runtime.GOARCH == \"386\" { /* no LR: do not call */ }","typeGuard":"func hasLinkRegister() bool {\n    switch runtime.GOARCH {\n    case \"arm64\", \"riscv64\", \"loong64\", \"ppc64le\":\n        return true\n    }\n    return false\n}","tryCatchPattern":"defer func() {\n    if r := recover(); r != nil { err = fmt.Errorf(\"LR unavailable: %v\", r) }\n}()","preventionTips":["Never assume LR exists on x86 family architectures","Branch on GOARCH for return-address extraction","Prefer delve's frame APIs over raw register access"],"tags":["i386","registers","panic","not-implemented"],"backgroundTag":"architecture-unsupported-operation","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}