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

Method globalVariablesRequest

src/gdb.ts:2678–2694  ·  view source on GitHub ↗
(response: DebugProtocol.VariablesResponse, args: DebugProtocol.VariablesArguments)

Source from the content-addressed store, hash-verified

2676 }
2677
2678 private async globalVariablesRequest(response: DebugProtocol.VariablesResponse, args: DebugProtocol.VariablesArguments): Promise<void> {
2679 const symbolInfo: SymbolInformation[] = this.symbolTable.getGlobalVariables();
2680 const globals: DebugProtocol.Variable[] = [];
2681 try {
2682 for (const symbol of symbolInfo) {
2683 const varObjName = `global_var_${symbol.name}`;
2684 const tmp = await this.updateOrCreateVariable(symbol.name, symbol.name, varObjName, args.variablesReference, -1, -1, true);
2685 globals.push(tmp);
2686 }
2687
2688 response.body = { variables: globals };
2689 this.sendResponse(response);
2690 }
2691 catch (err) {
2692 this.sendErrorResponse(response, 1, `Could not get global variable information: ${err}`);
2693 }
2694 }
2695
2696 private createStaticVarName(fHash: string, name: string): string {
2697 const varObjName = `static_var_${name}_${fHash}`;

Callers 1

variablesRequestMethod · 0.95

Calls 2

getGlobalVariablesMethod · 0.80

Tested by

no test coverage detected