{"record":{"id":"37508d9616824bbd","repo":"go-delve/delve","slug":"errtypenotfound","errorCode":"ErrTypeNotFound","errorMessage":"no type entry found, use 'types' for a list of valid types","messagePattern":"no type entry found, use 'types' for a list of valid types","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/dwarf/reader/reader.go","lineNumber":53,"sourceCode":"\n// AddrFor returns the address for the named entry.\nfunc (reader *Reader) AddrFor(name string, staticBase uint64, ptrSize int) (uint64, error) {\n\tentry, err := reader.FindEntryNamed(name, false)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tinstructions, ok := entry.Val(dwarf.AttrLocation).([]byte)\n\tif !ok {\n\t\treturn 0, errors.New(\"type assertion failed\")\n\t}\n\taddr, _, err := op.ExecuteStackProgram(op.DwarfRegisters{StaticBase: staticBase}, instructions, ptrSize, nil)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn uint64(addr), nil\n}\n\nvar ErrTypeNotFound = errors.New(\"no type entry found, use 'types' for a list of valid types\")\n\n// SeekToType moves the reader to the type specified by the entry,\n// optionally resolving typedefs and pointer types. If the reader is set\n// to a struct type the NextMemberVariable call can be used to walk all member data.\nfunc (reader *Reader) SeekToType(entry *dwarf.Entry, resolveTypedefs bool, resolvePointerTypes bool) (*dwarf.Entry, error) {\n\toffset, ok := entry.Val(dwarf.AttrType).(dwarf.Offset)\n\tif !ok {\n\t\treturn nil, errors.New(\"entry does not have a type attribute\")\n\t}\n\n\t// Seek to the first type offset\n\treader.Seek(offset)\n\n\t// Walk the types to the base\n\tfor typeEntry, err := reader.Next(); typeEntry != nil; typeEntry, err = reader.Next() {\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/dwarf/reader/reader.go#L35-L71","documentation":"ErrTypeNotFound is the sentinel error of pkg/dwarf/reader meaning the requested type could not be located in the DWARF info. SeekToType, SeekToTypeNamed and the compileTypeCast/compileTypeCastOrFuncCall helpers return it when no matching DW_TAG_*_type entry exists.","triggerScenarios":"SeekToTypeNamed for a type name absent from debug info; SeekToType walking an AttrType chain that terminates without a valid type; compiling a type cast expression for a type that does not exist in the binary's DWARF.","commonSituations":"Typo'd or non-exported type names at the call site, stripped or missing debug info (build with -w), or types eliminated by the linker/compiler that have no DWARF entry.","solutions":["Verify the type name spelling and that it is present (dlv 'types' command / readelf --debug-dump=info)","Rebuild the binary with full debug info (-gcflags=\"all=-N -l\", without -w/-s)","Handle errors.Is(err, reader.ErrTypeNotFound) to return a user-facing 'type not found' message"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"entry, err := reader.SeekToTypeNamed(\"MyType\")\nif errors.Is(err, reader.ErrTypeNotFound) { /* user-facing 'unknown type' message */ }","preventionTips":["List available types (dlv 'types') before resolving by name","Build binaries without stripped debug info","Confirm the type survived compilation/linking"],"tags":["dwarf","type-not-found","debug-info"],"backgroundTag":"type-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}