Skip to content

Commit 6420202

Browse files
committed
1. revise the code of static variable issue
1 parent 6a60b8b commit 6420202

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/backend/gdb_expansion.ts

-5
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,6 @@ export function expandValue(variableCreate: (arg: VariableObject | string, optio
229229
} else if (typeof val == "string" && val.startsWith("<...>")) {
230230
ref = variableCreate(getNamespace(name));
231231
val = "...";
232-
} else {
233-
let evaluateName = getNamespace(name);
234-
if(typeof evaluateName == "string" && evaluateName.includes("static ")) {
235-
evaluateName = evaluateName.replace("static ", "");
236-
}
237232
}
238233

239234
return {

src/mibase.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,6 @@ export class MI2DebugSession extends DebugSession {
434434
const variables: DebugProtocol.Variable[] = [];
435435
let id: VariableScope | string | VariableObject | ExtendedVariable = this.variableHandles.get(args.variablesReference);
436436

437-
if(typeof id == "string" && id.includes("static ")) {
438-
id = id.replace("static ", "");
439-
}
440-
441437
const createVariable = (arg: string | VariableObject, options?: any) => {
442438
if (options)
443439
return this.variableHandles.create(new ExtendedVariable(typeof arg === 'string' ? arg : arg.name, options));
@@ -535,6 +531,9 @@ export class MI2DebugSession extends DebugSession {
535531
this.sendErrorResponse(response, 1, `Could not expand variable: ${err}`);
536532
}
537533
} else if (typeof id == "string") {
534+
if(id.includes("static ")) {
535+
id = id.replace("static ", "");
536+
}
538537
// Variable members
539538
let variable;
540539
try {

0 commit comments

Comments
 (0)