diff --git a/src/backend/gdb_expansion.ts b/src/backend/gdb_expansion.ts index a14c93f..5ab92c5 100644 --- a/src/backend/gdb_expansion.ts +++ b/src/backend/gdb_expansion.ts @@ -1,7 +1,7 @@ import { MINode } from "./mi_parse"; -const resultRegex = /^([a-zA-Z_\-][a-zA-Z0-9_\-\>\ \<\:\(\)]*|\[\d+\])\s*=\s*/; -const variableRegex = /^[a-zA-Z_\-\'][a-zA-Z0-9_\-\>\ \\\']*/; +const resultRegex = /^([a-zA-Z_\-][a-zA-Z0-9_\-<> :(),]*|\[\d+\])\s*=\s*/; +const variableRegex = /^[a-zA-Z_\-\'\(][a-zA-Z0-9_\-\>\ \\\'\)\:]*/; const errorRegex = /^\<.+?\>/; const referenceStringRegex = /^(0x[0-9a-fA-F]+\s*)"/; const referenceRegex = /^(0x[0-9a-fA-F]+)/; @@ -278,6 +278,7 @@ export function expandValue(variableCreate: Function, value: string, root: strin const variableMatch = resultRegex.exec(value); if (!variableMatch) { + logger.debug(`parseResult: match fail, value:${JSON.stringify(value)}`); return undefined; } value = value.substring(variableMatch[0].length).trim(); @@ -288,7 +289,7 @@ export function expandValue(variableCreate: Function, value: string, root: strin } let tmpName = name.split(" "); - if(tmpName.length>1 && !name.includes("anonymous union")){ + if(tmpName.length>1 && !name.includes("anonymous union") && !name.includes(',')){ name = tmpName[tmpName.length-1]; } @@ -296,6 +297,8 @@ export function expandValue(variableCreate: Function, value: string, root: strin if (pushToStack){ stack.push(variable); } + logger.debug(`parseResult: will parseValue, name:${name}, value:${JSON.stringify(value)}`); + const val = parseValue(); if (pushToStack){ stack.pop();