Skip to content

Commit

Permalink
1. solve the problem of failed parsing of containers
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryRiley0 committed Aug 26, 2024
1 parent 7196ed1 commit ece8d98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Versioning].

### Added

- solve the problem of failed parsing of containers ([@henryriley0])
- fix gdb check error when debug beginning ([@henryriley0])
- fix implicitly type error in log message when build vsix ([@henryriley0])
- check for configured debugger before start to provide a nicer error message
Expand Down
9 changes: 7 additions & 2 deletions src/backend/gdb_expansion.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { VariableObject } from "./backend";
import { MINode } from "./mi_parse";

const resultRegex = /^([a-zA-Z_\-][a-zA-Z0-9_\-]*|\[\d+\])\s*=\s*/;
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*)"/;
Expand Down Expand Up @@ -108,7 +108,7 @@ export function expandValue(variableCreate: (arg: VariableObject | string, optio
let newValPos = newValPos1;
if (newValPos2 != -1 && newValPos2 < newValPos1)
newValPos = newValPos2;
if (newValPos != -1 && eqPos > newValPos || eqPos == -1) { // is value list
if (newValPos != -1 && eqPos > newValPos || eqPos == -1 || value.startsWith("std::")) { // is value list
const values = [];
stack.push("[0]");
let val = parseValue();
Expand Down Expand Up @@ -191,6 +191,11 @@ export function expandValue(variableCreate: (arg: VariableObject | string, optio
return parseCString();
else if (value[0] == '{')
return parseTupleOrList();
else if(value.startsWith("std::")){
const eqPos = value.indexOf("=");
value = value.substring(eqPos + 2);
return parseValue();
}
else
return parsePrimitive();
};
Expand Down

0 comments on commit ece8d98

Please sign in to comment.