{"record":{"id":"5213ccb225b88b36","repo":"go-delve/delve","slug":"could-not-find-type-for-runtime-g","errorCode":null,"errorMessage":"could not find type for runtime.g","messagePattern":"could not find type for runtime\\.g","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/breakpoints.go","lineNumber":589,"sourceCode":"\t// Not every OS/arch that we support has support for eBPF,\n\t// so check early and return an error if this is called on an\n\t// unsupported system.\n\tif !t.proc.SupportsBPF() {\n\t\treturn errors.New(\"eBPF is not supported\")\n\t}\n\tfns, err := t.BinInfo().FindFunction(fnName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Get information on the Goroutine so we can tell the\n\t// eBPF program where to find it in order to get the\n\t// goroutine ID.\n\trdr := t.BinInfo().Images[0].DwarfReader()\n\trdr.SeekToTypeNamed(\"runtime.g\")\n\ttyp, err := t.BinInfo().findType(\"runtime.g\")\n\tif err != nil {\n\t\treturn errors.New(\"could not find type for runtime.g\")\n\t}\n\tvar goidOffset int64\n\tswitch t := typ.(type) {\n\tcase *godwarf.StructType:\n\t\tfor _, field := range t.Field {\n\t\t\tif field.Name == \"goid\" {\n\t\t\t\tgoidOffset = field.ByteOffset\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, fn := range fns {\n\t\terr := t.setEBPFTracepointOnFunc(fn, goidOffset)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}","sourceCodeStart":571,"sourceCodeEnd":607,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/breakpoints.go#L571-L607","documentation":"Error \"could not find type for runtime.g\" thrown in go-delve/delve.","triggerScenarios":"Thrown at pkg/proc/breakpoints.go:589 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}