MCPcopy Create free account
hub / github.com/Marus/cortex-debug / scopesRequest

Method scopesRequest

src/gdb.ts:2495–2513  ·  view source on GitHub ↗
(response: DebugProtocol.ScopesResponse, args: DebugProtocol.ScopesArguments)

Source from the content-addressed store, hash-verified

2493 }
2494
2495 protected async scopesRequest(response: DebugProtocol.ScopesResponse, args: DebugProtocol.ScopesArguments): Promise<void> {
2496 const scopes = new Array<Scope>();
2497 scopes.push(new Scope('Local', args.frameId, false));
2498 scopes.push(new Scope('Global', HandleRegions.GLOBAL_HANDLE_ID, false));
2499
2500 const [threadId, frameId] = decodeReference(args.frameId);
2501 const frame = await this.miDebugger.getFrame(threadId, frameId);
2502 const file = getPathRelative(this.args.cwd, frame?.file || '');
2503 const staticId = HandleRegions.STATIC_HANDLES_START + args.frameId;
2504 scopes.push(new Scope(`Static: ${file}`, staticId, false));
2505 this.floatingVariableMap[staticId] = {}; // Clear any previously stored stuff for this scope
2506
2507 scopes.push(new Scope('Registers', HandleRegions.REG_HANDLE_START + args.frameId));
2508
2509 response.body = {
2510 scopes: scopes
2511 };
2512 this.sendResponse(response);
2513 }
2514
2515 private registerMap = new Map<string, number>();
2516 private registerMapReverse = new Map<number, string>();

Callers

nothing calls this directly

Calls 3

getPathRelativeFunction · 0.90
decodeReferenceFunction · 0.85
getFrameMethod · 0.80

Tested by

no test coverage detected