go-delve/delve · error

could not read memory

Error message

could not read memory

What it means

Error "could not read memory" thrown in go-delve/delve.

Source

Thrown at pkg/proc/native/threads_darwin.go:128

	return len(data), nil
}

func (t *nativeThread) ReadMemory(buf []byte, addr uint64) (int, error) {
	if ok, err := t.dbp.Valid(); !ok {
		return 0, err
	}
	if len(buf) == 0 {
		return 0, nil
	}
	var (
		vmData = unsafe.Pointer(&buf[0])
		vmAddr = C.mach_vm_address_t(addr)
		length = C.mach_msg_type_number_t(len(buf))
	)

	ret := C.read_memory(t.dbp.os.task, vmAddr, vmData, length)
	if ret < 0 {
		return 0, fmt.Errorf("could not read memory")
	}
	return len(buf), nil
}

func (t *nativeThread) restoreRegisters(sr proc.Registers) error {
	return errors.New("not implemented")
}

func (t *nativeThread) withDebugRegisters(f func(*amd64util.DebugRegisters) error) error {
	return proc.ErrHWBreakUnsupported
}

// SoftExc returns true if this thread received a software exception during the last resume.
func (t *nativeThread) SoftExc() bool {
	return false
}

View on GitHub (pinned to a23773e6c3)

When it happens

Trigger: Thrown at pkg/proc/native/threads_darwin.go:128 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/7cdcb089b530dec2. Report an issue: GitHub.