diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 0b70704c4f9..0f4dba2d2c0 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,15 @@ +2003-11-26 Mikhail Khodjaiants + Cleanup. + * CDebugModel.java + * CDebugUtils.java + * CRegisterManager.java + * CSharedLibraryManager.java + * CSignalManager.java + * CUpdateManager.java + * CDebugTarget.java + * CThread.java + * CVariable.java + 2003-11-10 Mikhail Khodjaiants Ensure that all breakpoint creation and modification operations are running in the UI thread. * CBreakpointManager.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java index b4bc5832bbc..0244754777b 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java @@ -304,9 +304,9 @@ public class CDebugModel boolean add ) throws DebugException { HashMap attributes = new HashMap( 10 ); - attributes.put( ICBreakpoint.ID, getPluginIdentifier() ); + attributes.put( IBreakpoint.ID, getPluginIdentifier() ); attributes.put( IMarker.LINE_NUMBER, new Integer( lineNumber ) ); - attributes.put( ICBreakpoint.ENABLED, new Boolean( enabled ) ); + attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); attributes.put( ICBreakpoint.CONDITION, condition ); return new CLineBreakpoint( resource, attributes, add ); @@ -353,13 +353,13 @@ public class CDebugModel boolean add ) throws DebugException { HashMap attributes = new HashMap( 10 ); - attributes.put( ICBreakpoint.ID, getPluginIdentifier() ); + attributes.put( IBreakpoint.ID, getPluginIdentifier() ); attributes.put( IMarker.CHAR_START, new Integer( 0 ) ); attributes.put( IMarker.CHAR_END, new Integer( 0 ) ); attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) ); attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) ); attributes.put( ICAddressBreakpoint.ADDRESS, Long.toString( address ) ); - attributes.put( ICBreakpoint.ENABLED, new Boolean( enabled ) ); + attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); attributes.put( ICBreakpoint.CONDITION, condition ); return new CAddressBreakpoint( resource, attributes, add ); @@ -399,7 +399,7 @@ public class CDebugModel boolean add ) throws DebugException { HashMap attributes = new HashMap( 10 ); - attributes.put( ICBreakpoint.ID, getPluginIdentifier() ); + attributes.put( IBreakpoint.ID, getPluginIdentifier() ); int lineNumber = -1; int charStart = -1; int charEnd = -1; @@ -423,7 +423,7 @@ public class CDebugModel attributes.put( IMarker.CHAR_END, new Integer( charEnd ) ); attributes.put( IMarker.LINE_NUMBER, new Integer( lineNumber ) ); attributes.put( ICFunctionBreakpoint.FUNCTION, CDebugUtils.getFunctionName( function ) ); - attributes.put( ICBreakpoint.ENABLED, new Boolean( enabled ) ); + attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); attributes.put( ICBreakpoint.CONDITION, condition ); return new CFunctionBreakpoint( CDebugUtils.getFunctionResource( function ), attributes, add ); @@ -463,7 +463,7 @@ public class CDebugModel boolean add ) throws DebugException { HashMap attributes = new HashMap( 10 ); - attributes.put( ICBreakpoint.ID, getPluginIdentifier() ); + attributes.put( IBreakpoint.ID, getPluginIdentifier() ); int lineNumber = -1; int charStart = -1; int charEnd = -1; @@ -487,7 +487,7 @@ public class CDebugModel attributes.put( IMarker.CHAR_END, new Integer( charEnd ) ); attributes.put( IMarker.LINE_NUMBER, new Integer( lineNumber ) ); attributes.put( ICFunctionBreakpoint.FUNCTION, CDebugUtils.getMethodQualifiedName( method ) ); - attributes.put( ICBreakpoint.ENABLED, new Boolean( enabled ) ); + attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); attributes.put( ICBreakpoint.CONDITION, condition ); return new CFunctionBreakpoint( CDebugUtils.getMethodResource( method ), attributes, add ); @@ -528,8 +528,8 @@ public class CDebugModel boolean add ) throws DebugException { HashMap attributes = new HashMap( 10 ); - attributes.put( ICBreakpoint.ID, getPluginIdentifier() ); - attributes.put( ICBreakpoint.ENABLED, new Boolean( enabled ) ); + attributes.put( IBreakpoint.ID, getPluginIdentifier() ); + attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); attributes.put( ICBreakpoint.CONDITION, condition ); attributes.put( ICWatchpoint.EXPRESSION, expression ); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java index e88b0f8f11d..180842d712e 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java @@ -196,14 +196,14 @@ public class CDebugUtils { if ( bytes.length != 8 ) return 0; - return (long)Long.parseLong( bytesToString( bytes, le, false ), 16 ); + return Long.parseLong( bytesToString( bytes, le, false ), 16 ); } public static long toLongLong( char[] bytes, boolean le ) { if ( bytes.length != 16 ) return 0; - return (long)Long.parseLong( bytesToString( bytes, le, false ), 16 ); + return Long.parseLong( bytesToString( bytes, le, false ), 16 ); } public static long toUnsignedLongLong( char[] bytes, boolean le ) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CRegisterManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CRegisterManager.java index f65cd928408..2a2590a0cff 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CRegisterManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CRegisterManager.java @@ -144,7 +144,7 @@ public class CRegisterManager extends CUpdateManager implements ICRegisterManage { if ( getDebugTarget() != null ) { - return ((CDebugTarget)getDebugTarget()).getCDISession().getRegisterManager(); + return getDebugTarget().getCDISession().getRegisterManager(); } return null; } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSharedLibraryManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSharedLibraryManager.java index d78d7a20bf3..017e93ba72f 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSharedLibraryManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSharedLibraryManager.java @@ -134,7 +134,7 @@ public class CSharedLibraryManager extends CUpdateManager implements ICSharedLib { if ( getDebugTarget() != null ) { - return ((CDebugTarget)getDebugTarget()).getCDISession().getSharedLibraryManager(); + return getDebugTarget().getCDISession().getSharedLibraryManager(); } return null; } @@ -158,7 +158,7 @@ public class CSharedLibraryManager extends CUpdateManager implements ICSharedLib } catch( CDIException e ) { - ((CDebugTarget)getDebugTarget()).targetRequestFailed( e.getMessage(), null ); + getDebugTarget().targetRequestFailed( e.getMessage(), null ); } } } @@ -177,13 +177,13 @@ public class CSharedLibraryManager extends CUpdateManager implements ICSharedLib } catch( CDIException e ) { - ((CDebugTarget)getDebugTarget()).targetRequestFailed( e.getMessage(), null ); + getDebugTarget().targetRequestFailed( e.getMessage(), null ); } } } private void setBreakpoints() { - ((CDebugTarget)getDebugTarget()).setBreakpoints(); + getDebugTarget().setBreakpoints(); } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java index 763f41adfb2..2b83ae9a0bd 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java @@ -47,11 +47,11 @@ public class CSignalManager extends CUpdateManager implements ICSignalManager { try { - ICDISignal[] cdiSignals = ((CDebugTarget)getDebugTarget()).getCDISession().getSignalManager().getSignals(); + ICDISignal[] cdiSignals = getDebugTarget().getCDISession().getSignalManager().getSignals(); ArrayList list = new ArrayList( cdiSignals.length ); for ( int i = 0; i < cdiSignals.length; ++i ) { - list.add( new CSignal( (CDebugTarget)getDebugTarget(), cdiSignals[i] ) ); + list.add( new CSignal( getDebugTarget(), cdiSignals[i] ) ); } fSignals = (ICSignal[])list.toArray( new ICSignal[list.size()] ); } @@ -126,7 +126,7 @@ public class CSignalManager extends CUpdateManager implements ICSignalManager { if ( getDebugTarget() != null ) { - return ((CDebugTarget)getDebugTarget()).getCDISession().getSignalManager(); + return getDebugTarget().getCDISession().getSignalManager(); } return null; } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CUpdateManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CUpdateManager.java index f32dc1dba90..d4a5fadf694 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CUpdateManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CUpdateManager.java @@ -68,7 +68,7 @@ public abstract class CUpdateManager implements ICUpdateManager, IAdaptable } catch( CDIException e ) { - ((CDebugTarget)getDebugTarget()).targetRequestFailed( e.getMessage(), null ); + getDebugTarget().targetRequestFailed( e.getMessage(), null ); } } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java index 017db08b048..0979d5292c3 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java @@ -199,16 +199,6 @@ public class CDebugTarget extends CDebugElement */ private ICDIConfiguration fConfig; - /** - * Whether terminate is supported. - */ - private boolean fSupportsTerminate; - - /** - * Whether disconnect is supported. - */ - private boolean fSupportsDisconnect; - /** * The current state identifier. */ @@ -289,8 +279,6 @@ public class CDebugTarget extends CDebugElement setCDITarget( cdiTarget ); setExecFile( file ); setConfiguration( cdiTarget.getSession().getConfiguration() ); - fSupportsTerminate = allowsTerminate & getConfiguration().supportsTerminate(); - fSupportsDisconnect = allowsDisconnect & getConfiguration().supportsDisconnect(); setThreadList( new ArrayList( 5 ) ); setDisassemblyManager( new DisassemblyManager( this ) ); setSharedLibraryManager( new CSharedLibraryManager( this ) ); @@ -351,7 +339,7 @@ public class CDebugTarget extends CDebugElement public void setBreakpoints() { IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager(); - IBreakpoint[] bps = (IBreakpoint[])manager.getBreakpoints( CDebugModel.getPluginIdentifier() ); + IBreakpoint[] bps = manager.getBreakpoints( CDebugModel.getPluginIdentifier() ); for ( int i = 0; i < bps.length; i++ ) { if ( bps[i] instanceof ICBreakpoint && @@ -369,7 +357,7 @@ public class CDebugTarget extends CDebugElement { } } - breakpointAdded( (ICBreakpoint)bps[i] ); + breakpointAdded( bps[i] ); } } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java index 6ddaf5bd635..9a226c324a6 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java @@ -735,7 +735,7 @@ public class CThread extends CDebugElement CStackFrame frame = (CStackFrame)(((IAdaptable)it.next()).getAdapter( CStackFrame.class )); if ( frame != null ) { - ((CStackFrame)frame).dispose(); + frame.dispose(); } } fStackFrames.clear(); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java index 4093166ece7..e223f85e5c3 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java @@ -200,7 +200,7 @@ public abstract class CVariable extends CDebugElement { if ( getCDIVariableObject() instanceof ICDIArgumentObject ) fCDIVariable = getCDISession().getVariableManager().createArgument( (ICDIArgumentObject)getCDIVariableObject() ); - else if ( getCDIVariableObject() instanceof ICDIVariableObject ) + else if ( getCDIVariableObject() != null ) fCDIVariable = getCDISession().getVariableManager().createVariable( getCDIVariableObject() ); } catch( CDIException e ) @@ -667,7 +667,7 @@ public abstract class CVariable extends CDebugElement */ protected ICDIValue retrieveValue() throws DebugException, CDIException { - return ( ((IDebugTarget)getParent().getDebugTarget()).isSuspended() && getCDIVariable() != null ) ? + return ( getParent().getDebugTarget().isSuspended() && getCDIVariable() != null ) ? getCDIVariable().getValue() : getLastKnownValue(); }