mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Bug 527419: Process async output with no variable
Change-Id: I4deb2b9db4421016b27e01353b0ae4745b139361 Signed-off-by: John Dallaway <john@dallaway.org.uk>
This commit is contained in:
parent
a58fc62ba6
commit
a08cc01f56
1 changed files with 12 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2012 QNX Software Systems and others.
|
* Copyright (c) 2000, 2017 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -9,6 +9,7 @@
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
* Wind River Systems - Modified for new DSF Reference Implementation
|
* Wind River Systems - Modified for new DSF Reference Implementation
|
||||||
* Mathias Kunter - Don't always parse backslashes (Bug 367456, Bug 307311)
|
* Mathias Kunter - Don't always parse backslashes (Bug 367456, Bug 307311)
|
||||||
|
* John Dallaway - Process async output with no variable (Bug 527419)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.dsf.mi.service.command.output;
|
package org.eclipse.cdt.dsf.mi.service.command.output;
|
||||||
|
@ -283,20 +284,23 @@ public class MIParser {
|
||||||
MIResult result = new MIResult();
|
MIResult result = new MIResult();
|
||||||
int equal;
|
int equal;
|
||||||
if (buffer.length() > 0 && Character.isLetter(buffer.charAt(0)) && (equal = buffer.indexOf('=')) != -1) {
|
if (buffer.length() > 0 && Character.isLetter(buffer.charAt(0)) && (equal = buffer.indexOf('=')) != -1) {
|
||||||
|
// Result is a variable and value
|
||||||
String variable = buffer.substring(0, equal);
|
String variable = buffer.substring(0, equal);
|
||||||
result.setVariable(variable);
|
result.setVariable(variable);
|
||||||
buffer.delete(0, equal + 1);
|
buffer.delete(0, equal + 1);
|
||||||
MIValue value = processMIValue(buffer);
|
MIValue value = processMIValue(buffer);
|
||||||
result.setMIValue(value);
|
result.setMIValue(value);
|
||||||
} else if(buffer.length()>0 && buffer.charAt(0)=='"') {
|
} else {
|
||||||
// This an error but we just swallow it and move on.
|
|
||||||
MIValue value = processMIValue(buffer);
|
MIValue value = processMIValue(buffer);
|
||||||
|
if (value != null) {
|
||||||
|
// Result is a value only (bug 527419)
|
||||||
result.setMIValue(value);
|
result.setMIValue(value);
|
||||||
} else {
|
} else {
|
||||||
result.setVariable(buffer.toString());
|
result.setVariable(buffer.toString());
|
||||||
result.setMIValue(new MIConst()); // Empty string:???
|
result.setMIValue(new MIConst()); // Empty string:???
|
||||||
buffer.setLength(0);
|
buffer.setLength(0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue