{"record":{"id":"7cdcb089b530dec2","repo":"go-delve/delve","slug":"could-not-read-memory","errorCode":null,"errorMessage":"could not read memory","messagePattern":"could not read memory","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/native/threads_darwin.go","lineNumber":128,"sourceCode":"\treturn len(data), nil\n}\n\nfunc (t *nativeThread) ReadMemory(buf []byte, addr uint64) (int, error) {\n\tif ok, err := t.dbp.Valid(); !ok {\n\t\treturn 0, err\n\t}\n\tif len(buf) == 0 {\n\t\treturn 0, nil\n\t}\n\tvar (\n\t\tvmData = unsafe.Pointer(&buf[0])\n\t\tvmAddr = C.mach_vm_address_t(addr)\n\t\tlength = C.mach_msg_type_number_t(len(buf))\n\t)\n\n\tret := C.read_memory(t.dbp.os.task, vmAddr, vmData, length)\n\tif ret < 0 {\n\t\treturn 0, fmt.Errorf(\"could not read memory\")\n\t}\n\treturn len(buf), nil\n}\n\nfunc (t *nativeThread) restoreRegisters(sr proc.Registers) error {\n\treturn errors.New(\"not implemented\")\n}\n\nfunc (t *nativeThread) withDebugRegisters(f func(*amd64util.DebugRegisters) error) error {\n\treturn proc.ErrHWBreakUnsupported\n}\n\n// SoftExc returns true if this thread received a software exception during the last resume.\nfunc (t *nativeThread) SoftExc() bool {\n\treturn false\n}\n","sourceCodeStart":110,"sourceCodeEnd":145,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/native/threads_darwin.go#L110-L145","documentation":"Error \"could not read memory\" thrown in go-delve/delve.","triggerScenarios":"Thrown at pkg/proc/native/threads_darwin.go:128 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"}