diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIValue.java index 604ceff2e7d..058af5cd15c 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIValue.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIValue.java @@ -32,6 +32,12 @@ public interface ICDIValue extends ICDIObject * @throws CDIException if this method fails. Reasons include: */ String getValueString() throws CDIException; + + /** + * Return the number of children. + * @return int children count + */ + int getChildrenNumber() throws CDIException; /** * @return true if value is a container like structure. diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Value.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Value.java index a9f983429de..ede41cbdd2c 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Value.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Value.java @@ -64,11 +64,19 @@ public class Value extends CObject implements ICDIValue { } return result; } + + /** + * @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getVariables() + */ + public int getChildrenNumber() throws CDIException { + return variable.getMIVar().getNumChild(); + } /** * @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getVariables() */ public boolean hasChildren() throws CDIException { + /* int number = 0; MISession mi = getCTarget().getCSession().getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -85,7 +93,8 @@ public class Value extends CObject implements ICDIValue { throw new CDIException(e.getMessage()); } return (number > 0); - + */ + return (getChildrenNumber() > 0); } /** * @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getVariables() diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java index 46135bba6b2..ab5ce61856c 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java @@ -76,7 +76,12 @@ public class MICommand extends Command String command = getToken() + getOperation(); if (options != null && options.length > 0) { for (int i = 0; i < options.length; i++) { - command += " " + options[i]; + if (options[i].indexOf('\t') != -1 || + options[i].indexOf(' ') != -1) { + command += " \"" + options[i] + "\""; + } else { + command += " " + options[i]; + } } } if (parameters != null && parameters.length > 0) { @@ -87,7 +92,7 @@ public class MICommand extends Command // According to the MI documentation '-' is not permitted //(parameters[i].indexOf('-') != -1 || parameters[i].indexof(\n) if (parameters[i].indexOf('\t') != -1 || - parameters[i].indexOf('\"') != -1|| + parameters[i].indexOf('\"') != -1 || parameters[i].indexOf(' ') != -1) { command += " \"" + parameters[i] + "\""; } else {