diff options
author | John Dallaway | 2017-11-17 21:15:59 +0000 |
---|---|---|
committer | John Dallaway | 2017-11-18 07:26:13 +0000 |
commit | a08cc01f5652940139be3074fafc335b194bc695 (patch) | |
tree | 3fd800239b800d13549914d84d5b600939c88025 /dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi | |
parent | a58fc62ba655f0bd89364d35f8263149f0cecece (diff) | |
download | org.eclipse.cdt-a08cc01f5652940139be3074fafc335b194bc695.tar.gz org.eclipse.cdt-a08cc01f5652940139be3074fafc335b194bc695.tar.xz org.eclipse.cdt-a08cc01f5652940139be3074fafc335b194bc695.zip |
Bug 527419: Process async output with no variable
Change-Id: I4deb2b9db4421016b27e01353b0ae4745b139361
Signed-off-by: John Dallaway <john@dallaway.org.uk>
Diffstat (limited to 'dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi')
-rw-r--r-- | dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIParser.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIParser.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIParser.java index d7812f10279..464f2828be9 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIParser.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIParser.java @@ -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 * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -9,6 +9,7 @@ * QNX Software Systems - Initial API and implementation * Wind River Systems - Modified for new DSF Reference Implementation * 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; @@ -283,19 +284,22 @@ public class MIParser { MIResult result = new MIResult(); int equal; 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); result.setVariable(variable); buffer.delete(0, equal + 1); MIValue value = processMIValue(buffer); result.setMIValue(value); - } else if(buffer.length()>0 && buffer.charAt(0)=='"') { - // This an error but we just swallow it and move on. - MIValue value = processMIValue(buffer); - result.setMIValue(value); } else { - result.setVariable(buffer.toString()); - result.setMIValue(new MIConst()); // Empty string:??? - buffer.setLength(0); + MIValue value = processMIValue(buffer); + if (value != null) { + // Result is a value only (bug 527419) + result.setMIValue(value); + } else { + result.setVariable(buffer.toString()); + result.setMIValue(new MIConst()); // Empty string:??? + buffer.setLength(0); + } } return result; } |