diff --git a/src/backend/gdb_expansion.ts b/src/backend/gdb_expansion.ts index e0c2fb2..b0485a9 100644 --- a/src/backend/gdb_expansion.ts +++ b/src/backend/gdb_expansion.ts @@ -282,6 +282,12 @@ export function expandValue(variableCreate: Function, value: string, root: strin if (name.charAt(name.length - 1) === ">") { name = name.slice(0, -1); } + + let tmpName = name.split(" "); + if(tmpName.length>1 && !name.includes("anonymous union")){ + name = tmpName[tmpName.length-1]; + } + //JSON.parse() if (pushToStack){ stack.push(variable); @@ -321,6 +327,14 @@ export function expandValue(variableCreate: Function, value: string, root: strin val = "..."; } else { evaluateName = getNamespace(name); + if(typeof evaluateName == "string" && evaluateName.includes("static ")) { + evaluateName = evaluateName.replace("static ", ""); + } + + let tmpName = evaluateName.split(' '); + if(tmpName.length>1){ + evaluateName = tmpName[tmpName.length-1]; + } } value = value.trim(); diff --git a/src/mibase.ts b/src/mibase.ts index ca04b3f..8a0b60c 100644 --- a/src/mibase.ts +++ b/src/mibase.ts @@ -505,7 +505,11 @@ export class MI2DebugSession extends DebugSession { protected async variablesRequest(response: DebugProtocol.VariablesResponse, args: DebugProtocol.VariablesArguments): Promise { const variables: DebugProtocol.Variable[] = []; - const id: VariableScope | string | VariableObject | ExtendedVariable = this.variableHandles.get(args.variablesReference); + 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));