mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
Restrict the "display as array" operation to the pointer types only.
This commit is contained in:
parent
ea1e4af9af
commit
9214f34e8d
2 changed files with 29 additions and 11 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2004-08-05 Mikhail Khodjaiants
|
||||||
|
Restrict the "display as array" operation to the pointer types only.
|
||||||
|
* CVariable.java
|
||||||
|
|
||||||
2004-08-05 Mikhail Khodjaiants
|
2004-08-05 Mikhail Khodjaiants
|
||||||
Warning cleanup.
|
Warning cleanup.
|
||||||
* CSharedLibraryManager.java
|
* CSharedLibraryManager.java
|
||||||
|
|
|
@ -493,11 +493,19 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
* Allow this operation only for the pointer types (???).
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.debug.core.model.ICastToArray#canCastToArray()
|
* @see org.eclipse.cdt.debug.core.model.ICastToArray#canCastToArray()
|
||||||
*/
|
*/
|
||||||
public boolean canCastToArray() {
|
public boolean canCastToArray() {
|
||||||
return ( getOriginal() != null && isEnabled() );
|
ICType type;
|
||||||
|
try {
|
||||||
|
type = getType();
|
||||||
|
return ( getOriginal() != null && isEnabled() && type.isPointer() );
|
||||||
|
}
|
||||||
|
catch( DebugException e ) {
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -506,12 +514,15 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
|
||||||
* @see org.eclipse.cdt.debug.core.model.ICastToArray#castToArray(int, int)
|
* @see org.eclipse.cdt.debug.core.model.ICastToArray#castToArray(int, int)
|
||||||
*/
|
*/
|
||||||
public void castToArray( int startIndex, int length ) throws DebugException {
|
public void castToArray( int startIndex, int length ) throws DebugException {
|
||||||
InternalVariable newVar = getOriginal().createShadow( startIndex, length );
|
InternalVariable current = getCurrentInternalVariable();
|
||||||
|
if ( current != null ) {
|
||||||
|
InternalVariable newVar = current.createShadow( startIndex, length );
|
||||||
if ( getShadow() != null )
|
if ( getShadow() != null )
|
||||||
getShadow().dispose();
|
getShadow().dispose();
|
||||||
setShadow( newVar );
|
setShadow( newVar );
|
||||||
fireChangeEvent( DebugEvent.STATE );
|
fireChangeEvent( DebugEvent.STATE );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -592,12 +603,15 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
|
||||||
* @see org.eclipse.cdt.debug.core.model.ICastToType#cast(java.lang.String)
|
* @see org.eclipse.cdt.debug.core.model.ICastToType#cast(java.lang.String)
|
||||||
*/
|
*/
|
||||||
public void cast( String type ) throws DebugException {
|
public void cast( String type ) throws DebugException {
|
||||||
InternalVariable newVar = getOriginal().createShadow( type );
|
InternalVariable current = getCurrentInternalVariable();
|
||||||
|
if ( current != null ) {
|
||||||
|
InternalVariable newVar = current.createShadow( type );
|
||||||
if ( getShadow() != null )
|
if ( getShadow() != null )
|
||||||
getShadow().dispose();
|
getShadow().dispose();
|
||||||
setShadow( newVar );
|
setShadow( newVar );
|
||||||
fireChangeEvent( DebugEvent.STATE );
|
fireChangeEvent( DebugEvent.STATE );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue