MCPcopy
hub / github.com/microsoft/vscode-js-debug / _onReadMemory

Method _onReadMemory

src/adapter/debugAdapter.ts:473–489  ·  view source on GitHub ↗
(params: Dap.ReadMemoryParams)

Source from the content-addressed store, hash-verified

471 }
472
473 async _onReadMemory(params: Dap.ReadMemoryParams): Promise<Dap.ReadMemoryResult> {
474 const ref = params.memoryReference;
475 const memory = await this.findVariableStore(v => v.hasMemory(ref))?.readMemory(
476 ref,
477 params.offset ?? 0,
478 params.count,
479 );
480 if (!memory) {
481 return { address: '0', unreadableBytes: params.count };
482 }
483
484 return {
485 address: '0',
486 data: memory.toString('base64'),
487 unreadableBytes: params.count - memory.length,
488 };
489 }
490
491 async _onWriteMemory(params: Dap.WriteMemoryParams): Promise<Dap.WriteMemoryResult> {
492 const ref = params.memoryReference;

Callers 1

constructorMethod · 0.95

Calls 4

findVariableStoreMethod · 0.95
hasMemoryMethod · 0.80
readMemoryMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected