diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 07e5d0ad532..d8db53ab1c3 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,8 @@ +2002-12-17 Mikhail Khodjaiants + Formatting 'char' types. + * CValue.java + * CModificationVariable.java + 2002-12-17 Mikhail Khodjaiants The core support of the prompting source locator. * ICSourceLocator.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java index a94beb7465b..91795d68c0a 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java @@ -9,6 +9,7 @@ package org.eclipse.cdt.debug.internal.core.model; import java.text.MessageFormat; import org.eclipse.cdt.debug.core.cdi.CDIException; +import org.eclipse.cdt.debug.core.cdi.ICDIFormat; import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; import org.eclipse.cdt.debug.core.model.ICValue; @@ -139,7 +140,7 @@ public abstract class CModificationVariable extends CVariable requestFailed( "Unable to set value.", null ); return null; } - if ( value.getType() == ICValue.TYPE_CHAR ) + if ( value.getType() == ICValue.TYPE_CHAR && getFormat() == ICDIFormat.NATURAL ) { char[] chars = oldExpression.toCharArray(); if ( chars.length != 1 ) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java index 1375dc5e9d1..146a1c912ac 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java @@ -289,27 +289,33 @@ public class CValue extends CDebugElement implements ICValue private String getCharValue( String value ) { - char result = '.'; + String result = ""; int index = value.indexOf( ' ' ); if ( index > 0 ) { + char resultChar = '.'; try { short shortValue = Short.parseShort( value.substring( 0, index ), 10 ); if ( shortValue >= 0 ) { - result = (char)shortValue; - if ( Character.isISOControl( result ) ) + resultChar = (char)shortValue; + if ( Character.isISOControl( resultChar ) ) { - result = '.'; + resultChar = '.'; } } } catch( NumberFormatException e ) { } + result = String.valueOf( resultChar ); } - return String.valueOf( result ); + else + { + result = value; + } + return result; } protected CVariable getParentVariable() diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index bc079f21836..0cf8c18e85b 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,3 +1,7 @@ +2002-12-17 Mikhail Khodjaiants + Formatting 'char' types. + * VariableFormatActionDelegate.java + 2002-12-17 Mikhail Khodjaiants Removed the "Primitive type display options" section from the C/C++ Debug preference page because of the different formattong strategy. * CDebugPreferencePage.java diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java index e124c66a617..ec309cc3f71 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java @@ -122,9 +122,10 @@ public class VariableFormatActionDelegate implements IObjectActionDelegate { switch( ((ICValue)value).getType() ) { - case ICValue.TYPE_ARRAY: +// case ICValue.TYPE_ARRAY: case ICValue.TYPE_SIMPLE: case ICValue.TYPE_POINTER: + case ICValue.TYPE_CHAR: enabled = true; break; }