{"record":{"id":"8043250aa23759ac","repo":"go-delve/delve","slug":"at-least-one-of-read-and-write-must-be-set-for-wat","errorCode":null,"errorMessage":"at least one of read and write must be set for watchpoint","messagePattern":"at least one of read and write must be set for watchpoint","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/breakpoints.go","lineNumber":722,"sourceCode":"\tfde, err := bi.frameEntries.FDEForPC(uprobePC)\n\tif err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"no FDE for uprobe PC %#x: %w\", uprobePC, err)\n\t}\n\tframectx, err := fde.EstablishFrame(uprobePC)\n\tif err != nil {\n\t\treturn 0, 0, fmt.Errorf(\"cannot establish frame at uprobe PC %#x: %w\", uprobePC, err)\n\t}\n\tif framectx.CFA.Rule != frame.RuleCFA {\n\t\treturn 0, 0, fmt.Errorf(\"unexpected CFA rule %d at uprobe PC %#x\", framectx.CFA.Rule, uprobePC)\n\t}\n\treturn uprobePC, framectx.CFA.Offset, nil\n}\n\n// SetWatchpoint sets a data breakpoint at addr and stores it in the\n// process wide break point table.\nfunc (t *Target) SetWatchpoint(logicalID int, scope *EvalScope, expr string, wtype WatchType, cond ast.Expr) (*Breakpoint, error) {\n\tif (wtype&WatchWrite == 0) && (wtype&WatchRead == 0) {\n\t\treturn nil, errors.New(\"at least one of read and write must be set for watchpoint\")\n\t}\n\n\tn, err := parser.ParseExpr(expr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\txv, err := scope.evalAST(n)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif xv.Addr == 0 || xv.Flags&VariableFakeAddress != 0 || xv.DwarfType == nil {\n\t\treturn nil, fmt.Errorf(\"can not watch %q\", expr)\n\t}\n\tif xv.Unreadable != nil {\n\t\treturn nil, fmt.Errorf(\"expression %q is unreadable: %v\", expr, xv.Unreadable)\n\t}\n\tif xv.Kind == reflect.UnsafePointer || xv.Kind == reflect.Invalid {\n\t\treturn nil, fmt.Errorf(\"can not watch variable of type %s\", xv.Kind.String())","sourceCodeStart":704,"sourceCodeEnd":740,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/breakpoints.go#L704-L740","documentation":"Error \"at least one of read and write must be set for watchpoint\" thrown in go-delve/delve.","triggerScenarios":"Thrown at pkg/proc/breakpoints.go:722 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-31T22:30:34.772Z"}