Merge pull request #128 from Marus/master
Bug fixes from Cortex-Debug extension
This commit is contained in:
commit
a7fd6a7369
5 changed files with 19 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ const referenceStringRegex = /^(0x[0-9a-fA-F]+\s*)"/;
|
|||
const referenceRegex = /^0x[0-9a-fA-F]+/;
|
||||
const nullpointerRegex = /^0x0+\b/;
|
||||
const charRegex = /^(\d+) ['"]/;
|
||||
const numberRegex = /^\d+/;
|
||||
const numberRegex = /^\d+(\.\d+)?/;
|
||||
const pointerCombineChar = ".";
|
||||
|
||||
export function isExpandable(value: string): number {
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ export function parseMI(output: string): MINode {
|
|||
let values = [];
|
||||
values.push(value);
|
||||
let remaining = output;
|
||||
while (value = parseCommaValue())
|
||||
while ((value = parseCommaValue()) !== undefined)
|
||||
values.push(value);
|
||||
output = output.substr(1); // ]
|
||||
return values;
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ export class MI2DebugSession extends DebugSession {
|
|||
const changelist = changes.result("changelist");
|
||||
changelist.forEach((change) => {
|
||||
const name = MINode.valueOf(change, "name");
|
||||
const vId = this.variableHandlesReverse[varObjName];
|
||||
const vId = this.variableHandlesReverse[name];
|
||||
const v = this.variableHandles.get(vId) as any;
|
||||
v.applyChanges(change);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -292,4 +292,15 @@ suite("GDB Value Expansion", () => {
|
|||
}
|
||||
]);
|
||||
});
|
||||
test("float values", () => {
|
||||
let node = `{ intval1 = 123, floatval1 = 123.456, intval2 = 3, floatval2 = 234.45 }`;
|
||||
let variables = expandValue(variableCreate, node);
|
||||
|
||||
assert.deepEqual(variables, [
|
||||
{ name: "intval1", value: "123", variablesReference: 0 },
|
||||
{ name: "floatval1", value: "123.456", variablesReference: 0 },
|
||||
{ name: "intval2", value: "3", variablesReference: 0 },
|
||||
{ name: "floatval2", value: "234.45", variablesReference: 0 }
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
|
@ -173,4 +173,9 @@ suite("MI Parse", () => {
|
|||
assert.equal(MINode.valueOf(obj[1], "@frame.fullname"), undefined);
|
||||
assert.equal(MINode.valueOf(obj[1], "@frame.line"), undefined);
|
||||
});
|
||||
test("empty string values", () => {
|
||||
let parsed = parseMI(`15^done,register-names=["r0","pc","","xpsr","","control"]`);
|
||||
let result = parsed.result('register-names');
|
||||
assert.deepEqual(result, ["r0", "pc", "", "xpsr", "", "control"]);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue