Skip to content

Commit

Permalink
1. revise the code of static variable issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryRiley0 committed Aug 23, 2024
1 parent 6a60b8b commit 6420202
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/backend/gdb_expansion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,6 @@ export function expandValue(variableCreate: (arg: VariableObject | string, optio
} else if (typeof val == "string" && val.startsWith("<...>")) {
ref = variableCreate(getNamespace(name));
val = "...";
} else {
let evaluateName = getNamespace(name);
if(typeof evaluateName == "string" && evaluateName.includes("static ")) {
evaluateName = evaluateName.replace("static ", "");
}
}

return {
Expand Down
7 changes: 3 additions & 4 deletions src/mibase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,6 @@ export class MI2DebugSession extends DebugSession {
const variables: DebugProtocol.Variable[] = [];
let id: VariableScope | string | VariableObject | ExtendedVariable = this.variableHandles.get(args.variablesReference);

if(typeof id == "string" && id.includes("static ")) {
id = id.replace("static ", "");
}

const createVariable = (arg: string | VariableObject, options?: any) => {
if (options)
return this.variableHandles.create(new ExtendedVariable(typeof arg === 'string' ? arg : arg.name, options));
Expand Down Expand Up @@ -535,6 +531,9 @@ export class MI2DebugSession extends DebugSession {
this.sendErrorResponse(response, 1, `Could not expand variable: ${err}`);
}
} else if (typeof id == "string") {
if(id.includes("static ")) {
id = id.replace("static ", "");
}
// Variable members
let variable;
try {
Expand Down

0 comments on commit 6420202

Please sign in to comment.