{"record":{"id":"195da73b0d6676ae","repo":"go-delve/delve","slug":"could-not-find-memory-reference","errorCode":null,"errorMessage":"could not find memory reference","messagePattern":"could not find memory reference","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/dap/server.go","lineNumber":3990,"sourceCode":"\t\t\tlastFile, lastLine = instruction.Loc.File, instruction.Loc.Line\n\t\t}\n\t}\n\n\tresponse := &dap.DisassembleResponse{\n\t\tResponse: *s.newResponse(request.Request),\n\t\tBody: dap.DisassembleResponseBody{\n\t\t\tInstructions: instructions,\n\t\t},\n\t}\n\ts.send(response)\n}\n\nfunc findInstructions(procInstructions []proc.AsmInstruction, addr uint64, instructionOffset, count int) ([]proc.AsmInstruction, int, error) {\n\tref := sort.Search(len(procInstructions), func(i int) bool {\n\t\treturn procInstructions[i].Loc.PC >= addr\n\t})\n\tif ref == len(procInstructions) || procInstructions[ref].Loc.PC != addr {\n\t\treturn nil, -1, errors.New(\"could not find memory reference\")\n\t}\n\t// offset is the number of instructions that should appear before the first instruction\n\t// returned by findInstructions.\n\toffset := 0\n\tif ref+instructionOffset < 0 {\n\t\toffset = -(ref + instructionOffset)\n\t}\n\t// Figure out the index to slice at.\n\tstartIdx := ref + instructionOffset\n\tendIdx := ref + instructionOffset + count\n\tif endIdx <= 0 || startIdx >= len(procInstructions) {\n\t\treturn []proc.AsmInstruction{}, 0, nil\n\t}\n\t// Adjust start and end to be inbounds.\n\tif startIdx < 0 {\n\t\toffset = -startIdx\n\t\tstartIdx = 0\n\t}","sourceCodeStart":3972,"sourceCodeEnd":4008,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/dap/server.go#L3972-L4008","documentation":"Error \"could not find memory reference\" thrown in go-delve/delve.","triggerScenarios":"Thrown at service/dap/server.go:3990 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"}