mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 15:25:49 +02:00
Formatting 'char' types.
This commit is contained in:
parent
427def3fc0
commit
0f09d718fc
5 changed files with 24 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2002-12-17 Mikhail Khodjaiants
|
||||||
|
Formatting 'char' types.
|
||||||
|
* CValue.java
|
||||||
|
* CModificationVariable.java
|
||||||
|
|
||||||
2002-12-17 Mikhail Khodjaiants
|
2002-12-17 Mikhail Khodjaiants
|
||||||
The core support of the prompting source locator.
|
The core support of the prompting source locator.
|
||||||
* ICSourceLocator.java
|
* ICSourceLocator.java
|
||||||
|
|
|
@ -9,6 +9,7 @@ package org.eclipse.cdt.debug.internal.core.model;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
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.ICDIValue;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
|
||||||
import org.eclipse.cdt.debug.core.model.ICValue;
|
import org.eclipse.cdt.debug.core.model.ICValue;
|
||||||
|
@ -139,7 +140,7 @@ public abstract class CModificationVariable extends CVariable
|
||||||
requestFailed( "Unable to set value.", null );
|
requestFailed( "Unable to set value.", null );
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if ( value.getType() == ICValue.TYPE_CHAR )
|
if ( value.getType() == ICValue.TYPE_CHAR && getFormat() == ICDIFormat.NATURAL )
|
||||||
{
|
{
|
||||||
char[] chars = oldExpression.toCharArray();
|
char[] chars = oldExpression.toCharArray();
|
||||||
if ( chars.length != 1 )
|
if ( chars.length != 1 )
|
||||||
|
|
|
@ -289,27 +289,33 @@ public class CValue extends CDebugElement implements ICValue
|
||||||
|
|
||||||
private String getCharValue( String value )
|
private String getCharValue( String value )
|
||||||
{
|
{
|
||||||
char result = '.';
|
String result = "";
|
||||||
int index = value.indexOf( ' ' );
|
int index = value.indexOf( ' ' );
|
||||||
if ( index > 0 )
|
if ( index > 0 )
|
||||||
{
|
{
|
||||||
|
char resultChar = '.';
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
short shortValue = Short.parseShort( value.substring( 0, index ), 10 );
|
short shortValue = Short.parseShort( value.substring( 0, index ), 10 );
|
||||||
if ( shortValue >= 0 )
|
if ( shortValue >= 0 )
|
||||||
{
|
{
|
||||||
result = (char)shortValue;
|
resultChar = (char)shortValue;
|
||||||
if ( Character.isISOControl( result ) )
|
if ( Character.isISOControl( resultChar ) )
|
||||||
{
|
{
|
||||||
result = '.';
|
resultChar = '.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( NumberFormatException e )
|
catch( NumberFormatException e )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
result = String.valueOf( resultChar );
|
||||||
}
|
}
|
||||||
return String.valueOf( result );
|
else
|
||||||
|
{
|
||||||
|
result = value;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CVariable getParentVariable()
|
protected CVariable getParentVariable()
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2002-12-17 Mikhail Khodjaiants
|
||||||
|
Formatting 'char' types.
|
||||||
|
* VariableFormatActionDelegate.java
|
||||||
|
|
||||||
2002-12-17 Mikhail Khodjaiants
|
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.
|
Removed the "Primitive type display options" section from the C/C++ Debug preference page because of the different formattong strategy.
|
||||||
* CDebugPreferencePage.java
|
* CDebugPreferencePage.java
|
||||||
|
|
|
@ -122,9 +122,10 @@ public class VariableFormatActionDelegate implements IObjectActionDelegate
|
||||||
{
|
{
|
||||||
switch( ((ICValue)value).getType() )
|
switch( ((ICValue)value).getType() )
|
||||||
{
|
{
|
||||||
case ICValue.TYPE_ARRAY:
|
// case ICValue.TYPE_ARRAY:
|
||||||
case ICValue.TYPE_SIMPLE:
|
case ICValue.TYPE_SIMPLE:
|
||||||
case ICValue.TYPE_POINTER:
|
case ICValue.TYPE_POINTER:
|
||||||
|
case ICValue.TYPE_CHAR:
|
||||||
enabled = true;
|
enabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue