Add "var_" prefix to var object names
The name of var object should begin with a letter, so names like "_id" caused errors.
This commit is contained in:
parent
c313af85b2
commit
90c7b76f78
1 changed files with 5 additions and 4 deletions
|
|
@ -335,22 +335,23 @@ export class MI2DebugSession extends DebugSession {
|
||||||
for (const variable of stack) {
|
for (const variable of stack) {
|
||||||
if (this.useVarObjects) {
|
if (this.useVarObjects) {
|
||||||
try {
|
try {
|
||||||
|
let varObjName = `var_${variable.name}`;
|
||||||
let varObj: VariableObject;
|
let varObj: VariableObject;
|
||||||
try {
|
try {
|
||||||
const changes = await this.miDebugger.varUpdate(variable.name);
|
const changes = await this.miDebugger.varUpdate(varObjName);
|
||||||
const changelist = changes.result("changelist");
|
const changelist = changes.result("changelist");
|
||||||
changelist.forEach((change) => {
|
changelist.forEach((change) => {
|
||||||
const name = MINode.valueOf(change, "name");
|
const name = MINode.valueOf(change, "name");
|
||||||
const vId = this.variableHandlesReverse[variable.name];
|
const vId = this.variableHandlesReverse[varObjName];
|
||||||
const v = this.variableHandles.get(vId) as any;
|
const v = this.variableHandles.get(vId) as any;
|
||||||
v.applyChanges(change);
|
v.applyChanges(change);
|
||||||
});
|
});
|
||||||
const varId = this.variableHandlesReverse[variable.name];
|
const varId = this.variableHandlesReverse[varObjName];
|
||||||
varObj = this.variableHandles.get(varId) as any;
|
varObj = this.variableHandles.get(varId) as any;
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
if (err instanceof MIError && err.message == "Variable object not found") {
|
if (err instanceof MIError && err.message == "Variable object not found") {
|
||||||
varObj = await this.miDebugger.varCreate(variable.name, variable.name);
|
varObj = await this.miDebugger.varCreate(variable.name, varObjName);
|
||||||
const varId = findOrCreateVariable(varObj);
|
const varId = findOrCreateVariable(varObj);
|
||||||
varObj.exp = variable.name;
|
varObj.exp = variable.name;
|
||||||
varObj.id = varId;
|
varObj.id = varId;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue