Updated to CLI version 0.9.0-rc2

This commit is contained in:
Miro Spönemann 2020-02-24 15:26:35 +01:00
parent beb529cf15
commit 1bc996d8d8
3 changed files with 24 additions and 24 deletions

View File

@ -91,7 +91,7 @@ export class ArduinoDebugSession extends GDBDebugSession {
// new Scope('Pins', this.variableHandles.create(pins), false), // new Scope('Pins', this.variableHandles.create(pins), false),
new Scope('Local', this.variableHandles.create(frame), false), new Scope('Local', this.variableHandles.create(frame), false),
new Scope('Global', GLOBAL_HANDLE_ID, false), new Scope('Global', GLOBAL_HANDLE_ID, false),
new Scope('Static', STATIC_HANDLES_START + parseInt(args.frameId as any, 10), false) // new Scope('Static', STATIC_HANDLES_START + parseInt(args.frameId as any, 10), false)
], ],
}; };

View File

@ -44,6 +44,28 @@ export class ArduinoVariableHandler {
return variables; return variables;
} }
/** TODO */
async getStaticVariables(frameHandle: number): Promise<DebugProtocol.Variable[]> {
throw new Error('Static variables are not supported yet.');
const frame = this.frameHandles.get(frameHandle);
const result = await this.gdb.sendStackInfoFrame(this.gdb, frame.threadId, frame.frameId);
const file = path.normalize(result.frame.file || '');
const symbolInfo: any[] = [] // this.symbolTable.getStaticVariables(file);
const variables: DebugProtocol.Variable[] = [];
// Fetch stack depth to obtain frameId/threadId/depth tuple
const stackDepth = await mi.sendStackInfoDepth(this.gdb, { maxDepth: 100 });
const depth = parseInt(stackDepth.depth, 10);
for (const symbol of symbolInfo) {
const name = `${file}_static_var_${symbol.name}`;
const variable = await this.getVariables(frame, name, symbol.name, depth);
variables.push(variable);
}
return variables;
}
private async getVariables(frame: FrameReference, name: string, expression: string, depth: number): Promise<DebugProtocol.Variable> { private async getVariables(frame: FrameReference, name: string, expression: string, depth: number): Promise<DebugProtocol.Variable> {
let global = this.varMgr.getVar(frame.frameId, frame.threadId, depth, name); let global = this.varMgr.getVar(frame.frameId, frame.threadId, depth, name);
@ -79,28 +101,6 @@ export class ArduinoVariableHandler {
}; };
} }
/** TODO */
async getStaticVariables(frameHandle: number): Promise<DebugProtocol.Variable[]> {
throw new Error('Static variables are not supported yet.');
const frame = this.frameHandles.get(frameHandle);
const result = await this.gdb.sendStackInfoFrame(this.gdb, frame.threadId, frame.frameId);
const file = path.normalize(result.frame.file || '');
const symbolInfo: any[] = [] // this.symbolTable.getStaticVariables(file);
const variables: DebugProtocol.Variable[] = [];
// Fetch stack depth to obtain frameId/threadId/depth tuple
const stackDepth = await mi.sendStackInfoDepth(this.gdb, { maxDepth: 100 });
const depth = parseInt(stackDepth.depth, 10);
for (const symbol of symbolInfo) {
const name = `${file}_static_var_${symbol.name}`;
const variable = await this.getVariables(frame, name, symbol.name, depth);
variables.push(variable);
}
return variables;
}
async handlePinStatusRequest(): Promise<DebugProtocol.Variable[]> { async handlePinStatusRequest(): Promise<DebugProtocol.Variable[]> {
const variables: DebugProtocol.Variable[] = []; const variables: DebugProtocol.Variable[] = [];
variables.push({ variables.push({

View File

@ -10,7 +10,7 @@
(() => { (() => {
const DEFAULT_VERSION = '0.7.1'; // require('moment')().format('YYYYMMDD'); const DEFAULT_VERSION = '0.9.0-rc2'; // require('moment')().format('YYYYMMDD');
const path = require('path'); const path = require('path');
const shell = require('shelljs'); const shell = require('shelljs');