Skip to content

Commit ece8d98

Browse files
committed
1. solve the problem of failed parsing of containers
1 parent 7196ed1 commit ece8d98

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Versioning].
1212

1313
### Added
1414

15+
- solve the problem of failed parsing of containers ([@henryriley0])
1516
- fix gdb check error when debug beginning ([@henryriley0])
1617
- fix implicitly type error in log message when build vsix ([@henryriley0])
1718
- check for configured debugger before start to provide a nicer error message

src/backend/gdb_expansion.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { VariableObject } from "./backend";
22
import { MINode } from "./mi_parse";
33

4-
const resultRegex = /^([a-zA-Z_\-][a-zA-Z0-9_\-]*|\[\d+\])\s*=\s*/;
4+
const resultRegex = /^([a-zA-Z_\-][a-zA-Z0-9_\-:]*|\[\d+\])\s*=\s*/;
55
const variableRegex = /^[a-zA-Z_\-][a-zA-Z0-9_\-]*/;
66
const errorRegex = /^\<.+?\>/;
77
const referenceStringRegex = /^(0x[0-9a-fA-F]+\s*)"/;
@@ -108,7 +108,7 @@ export function expandValue(variableCreate: (arg: VariableObject | string, optio
108108
let newValPos = newValPos1;
109109
if (newValPos2 != -1 && newValPos2 < newValPos1)
110110
newValPos = newValPos2;
111-
if (newValPos != -1 && eqPos > newValPos || eqPos == -1) { // is value list
111+
if (newValPos != -1 && eqPos > newValPos || eqPos == -1 || value.startsWith("std::")) { // is value list
112112
const values = [];
113113
stack.push("[0]");
114114
let val = parseValue();
@@ -191,6 +191,11 @@ export function expandValue(variableCreate: (arg: VariableObject | string, optio
191191
return parseCString();
192192
else if (value[0] == '{')
193193
return parseTupleOrList();
194+
else if(value.startsWith("std::")){
195+
const eqPos = value.indexOf("=");
196+
value = value.substring(eqPos + 2);
197+
return parseValue();
198+
}
194199
else
195200
return parsePrimitive();
196201
};

0 commit comments

Comments
 (0)