mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 20:35:38 +02:00
Core support of 'Auto-Refresh' and 'Refresh' actions.
This commit is contained in:
parent
903e1c11d8
commit
f0b4f5668f
8 changed files with 354 additions and 155 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
2003-03-31 Mikhail Khodjaiants
|
||||||
|
The new abstract class ('CUpdateManager') is added to provide a basic implementation of ICUpdateManager.
|
||||||
|
CSignalManager, CSharedLibraryManager and CRegisterManager extend this class.
|
||||||
|
* ICRegisterManager.java: new
|
||||||
|
* CRegisterManager.java: new
|
||||||
|
* CSharedLibraryManager.java
|
||||||
|
* CSignalManager.java
|
||||||
|
* CUpdateManager.java: new
|
||||||
|
* CDebugTarget.java
|
||||||
|
* CRegisterGroup.java
|
||||||
|
|
||||||
2003-03-28 Mikhail Khodjaiants
|
2003-03-28 Mikhail Khodjaiants
|
||||||
Use the 'exists' method of the 'IFile' interface instead of using 'toFile().exists()' for 'IPath'.
|
Use the 'exists' method of the 'IFile' interface instead of using 'toFile().exists()' for 'IPath'.
|
||||||
* CDirectorySourceLocation.java
|
* CDirectorySourceLocation.java
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||||
|
* All Rights Reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.eclipse.cdt.debug.core;
|
||||||
|
|
||||||
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
|
import org.eclipse.debug.core.DebugException;
|
||||||
|
import org.eclipse.debug.core.model.IRegisterGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enter type comment.
|
||||||
|
*
|
||||||
|
* @since Mar 31, 2003
|
||||||
|
*/
|
||||||
|
public interface ICRegisterManager extends ICUpdateManager, IAdaptable
|
||||||
|
{
|
||||||
|
void initialize();
|
||||||
|
|
||||||
|
IRegisterGroup[] getRegisterGroups() throws DebugException;
|
||||||
|
|
||||||
|
void addRegisterGroup( IRegisterGroup group );
|
||||||
|
|
||||||
|
void removeRegisterGroup( IRegisterGroup group );
|
||||||
|
|
||||||
|
void removeAllRegisterGroups();
|
||||||
|
|
||||||
|
void reset();
|
||||||
|
|
||||||
|
void dispose();
|
||||||
|
}
|
|
@ -0,0 +1,147 @@
|
||||||
|
/*
|
||||||
|
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||||
|
* All Rights Reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.eclipse.cdt.debug.internal.core;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||||
|
import org.eclipse.cdt.debug.core.ICRegisterManager;
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.ICDIManager;
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
|
||||||
|
import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
|
||||||
|
import org.eclipse.cdt.debug.internal.core.model.CRegisterGroup;
|
||||||
|
import org.eclipse.debug.core.DebugException;
|
||||||
|
import org.eclipse.debug.core.model.IRegisterGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enter type comment.
|
||||||
|
*
|
||||||
|
* @since Mar 31, 2003
|
||||||
|
*/
|
||||||
|
public class CRegisterManager extends CUpdateManager implements ICRegisterManager
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Collection of register groups added to this target. Values are of type <code>CRegisterGroup</code>.
|
||||||
|
*/
|
||||||
|
private List fRegisterGroups;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public CRegisterManager( CDebugTarget target )
|
||||||
|
{
|
||||||
|
super( target );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
||||||
|
*/
|
||||||
|
public Object getAdapter( Class adapter )
|
||||||
|
{
|
||||||
|
if ( ICRegisterManager.class.equals( adapter ) )
|
||||||
|
return this;
|
||||||
|
if ( CRegisterManager.class.equals( adapter ) )
|
||||||
|
return this;
|
||||||
|
return super.getAdapter( adapter );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICRegisterManager#dispose()
|
||||||
|
*/
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
removeAllRegisterGroups();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICRegisterManager#addRegisterGroup(org.eclipse.debug.core.model.IRegisterGroup)
|
||||||
|
*/
|
||||||
|
public void addRegisterGroup( IRegisterGroup group )
|
||||||
|
{
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICRegisterManager#getRegisterGroups()
|
||||||
|
*/
|
||||||
|
public IRegisterGroup[] getRegisterGroups() throws DebugException
|
||||||
|
{
|
||||||
|
return (IRegisterGroup[])fRegisterGroups.toArray( new IRegisterGroup[fRegisterGroups.size()] );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICRegisterManager#initialize()
|
||||||
|
*/
|
||||||
|
public void initialize()
|
||||||
|
{
|
||||||
|
fRegisterGroups = new ArrayList( 20 );
|
||||||
|
createMainRegisterGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICRegisterManager#removeAllRegisterGroups()
|
||||||
|
*/
|
||||||
|
public void removeAllRegisterGroups()
|
||||||
|
{
|
||||||
|
Iterator it = fRegisterGroups.iterator();
|
||||||
|
while( it.hasNext() )
|
||||||
|
{
|
||||||
|
((CRegisterGroup)it.next()).dispose();
|
||||||
|
}
|
||||||
|
fRegisterGroups.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICRegisterManager#removeRegisterGroup(org.eclipse.debug.core.model.IRegisterGroup)
|
||||||
|
*/
|
||||||
|
public void removeRegisterGroup( IRegisterGroup group )
|
||||||
|
{
|
||||||
|
fRegisterGroups.remove( group );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createMainRegisterGroup()
|
||||||
|
{
|
||||||
|
ICDIRegisterObject[] regObjects = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
regObjects = getDebugTarget().getCDISession().getRegisterManager().getRegisterObjects();
|
||||||
|
}
|
||||||
|
catch( CDIException e )
|
||||||
|
{
|
||||||
|
CDebugCorePlugin.log( e );
|
||||||
|
}
|
||||||
|
if ( regObjects != null )
|
||||||
|
{
|
||||||
|
fRegisterGroups.add( new CRegisterGroup( getDebugTarget(), "Main", regObjects ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICRegisterManager#reset()
|
||||||
|
*/
|
||||||
|
public void reset()
|
||||||
|
{
|
||||||
|
Iterator it = fRegisterGroups.iterator();
|
||||||
|
while( it.hasNext() )
|
||||||
|
{
|
||||||
|
((CRegisterGroup)it.next()).resetChangeFlags();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ICDIManager getCDIManager()
|
||||||
|
{
|
||||||
|
if ( getDebugTarget() != null )
|
||||||
|
{
|
||||||
|
return ((CDebugTarget)getDebugTarget()).getCDISession().getRegisterManager();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,24 +9,22 @@ import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.ICSharedLibraryManager;
|
import org.eclipse.cdt.debug.core.ICSharedLibraryManager;
|
||||||
import org.eclipse.cdt.debug.core.ICUpdateManager;
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.ICDIManager;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager;
|
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
|
||||||
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
|
|
||||||
import org.eclipse.cdt.debug.core.model.ICSharedLibrary;
|
import org.eclipse.cdt.debug.core.model.ICSharedLibrary;
|
||||||
import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
|
import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
|
||||||
import org.eclipse.cdt.debug.internal.core.model.CSharedLibrary;
|
import org.eclipse.cdt.debug.internal.core.model.CSharedLibrary;
|
||||||
import org.eclipse.debug.core.DebugEvent;
|
import org.eclipse.debug.core.DebugEvent;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.core.model.IDebugTarget;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* Enter type comment.
|
||||||
*
|
*
|
||||||
* @since: Jan 16, 2003
|
* @since: Jan 16, 2003
|
||||||
*/
|
*/
|
||||||
public class CSharedLibraryManager implements ICSharedLibraryManager
|
public class CSharedLibraryManager extends CUpdateManager implements ICSharedLibraryManager
|
||||||
{
|
{
|
||||||
private CDebugTarget fDebugTarget = null;
|
private CDebugTarget fDebugTarget = null;
|
||||||
private ArrayList fSharedLibraries;
|
private ArrayList fSharedLibraries;
|
||||||
|
@ -36,7 +34,7 @@ public class CSharedLibraryManager implements ICSharedLibraryManager
|
||||||
*/
|
*/
|
||||||
public CSharedLibraryManager( CDebugTarget target )
|
public CSharedLibraryManager( CDebugTarget target )
|
||||||
{
|
{
|
||||||
setDebugTarget( target );
|
super( target );
|
||||||
fSharedLibraries = new ArrayList( 5 );
|
fSharedLibraries = new ArrayList( 5 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,10 +101,6 @@ public class CSharedLibraryManager implements ICSharedLibraryManager
|
||||||
*/
|
*/
|
||||||
public Object getAdapter( Class adapter )
|
public Object getAdapter( Class adapter )
|
||||||
{
|
{
|
||||||
if ( adapter.equals( ICUpdateManager.class ) )
|
|
||||||
{
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
if ( adapter.equals( ICSharedLibraryManager.class ) )
|
if ( adapter.equals( ICSharedLibraryManager.class ) )
|
||||||
{
|
{
|
||||||
return this;
|
return this;
|
||||||
|
@ -115,25 +109,7 @@ public class CSharedLibraryManager implements ICSharedLibraryManager
|
||||||
{
|
{
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
if ( adapter.equals( IDebugTarget.class ) )
|
return super.getAdapter( adapter );
|
||||||
{
|
|
||||||
return fDebugTarget;
|
|
||||||
}
|
|
||||||
if ( adapter.equals( ICDebugTarget.class ) )
|
|
||||||
{
|
|
||||||
return fDebugTarget;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IDebugTarget getDebugTarget()
|
|
||||||
{
|
|
||||||
return fDebugTarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setDebugTarget( CDebugTarget target )
|
|
||||||
{
|
|
||||||
fDebugTarget = target;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CSharedLibrary find( ICDISharedLibrary cdiLibrary )
|
protected CSharedLibrary find( ICDISharedLibrary cdiLibrary )
|
||||||
|
@ -148,48 +124,7 @@ public class CSharedLibraryManager implements ICSharedLibraryManager
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
protected ICDIManager getCDIManager()
|
||||||
* @see org.eclipse.cdt.debug.core.ICUpdateManager#getAutoModeEnabled()
|
|
||||||
*/
|
|
||||||
public boolean getAutoModeEnabled()
|
|
||||||
{
|
|
||||||
if ( getCDIManager() != null )
|
|
||||||
{
|
|
||||||
return getCDIManager().isAutoUpdate();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.debug.core.ICUpdateManager#setAutoModeEnabled(boolean)
|
|
||||||
*/
|
|
||||||
public void setAutoModeEnabled( boolean enable )
|
|
||||||
{
|
|
||||||
if ( getCDIManager() != null )
|
|
||||||
{
|
|
||||||
getCDIManager().setAutoUpdate( enable );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.debug.core.ICUpdateManager#update()
|
|
||||||
*/
|
|
||||||
public void update() throws DebugException
|
|
||||||
{
|
|
||||||
if ( getCDIManager() != null )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
getCDIManager().update();
|
|
||||||
}
|
|
||||||
catch( CDIException e )
|
|
||||||
{
|
|
||||||
((CDebugTarget)getDebugTarget()).targetRequestFailed( e.toString(), null );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private ICDISharedLibraryManager getCDIManager()
|
|
||||||
{
|
{
|
||||||
if ( getDebugTarget() != null )
|
if ( getDebugTarget() != null )
|
||||||
{
|
{
|
||||||
|
@ -198,24 +133,12 @@ public class CSharedLibraryManager implements ICSharedLibraryManager
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.debug.core.ICUpdateManager#canUpdate()
|
|
||||||
*/
|
|
||||||
public boolean canUpdate()
|
|
||||||
{
|
|
||||||
if ( getDebugTarget() != null )
|
|
||||||
{
|
|
||||||
return getDebugTarget().isSuspended();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#loadSymbols(org.eclipse.cdt.debug.core.model.ICSharedLibrary)
|
* @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#loadSymbols(org.eclipse.cdt.debug.core.model.ICSharedLibrary)
|
||||||
*/
|
*/
|
||||||
public void loadSymbols( ICSharedLibrary[] libraries ) throws DebugException
|
public void loadSymbols( ICSharedLibrary[] libraries ) throws DebugException
|
||||||
{
|
{
|
||||||
ICDISharedLibraryManager slm = getCDIManager();
|
ICDISharedLibraryManager slm = (ICDISharedLibraryManager)getCDIManager();
|
||||||
if ( slm != null )
|
if ( slm != null )
|
||||||
{
|
{
|
||||||
ArrayList cdiLibs = new ArrayList( libraries.length );
|
ArrayList cdiLibs = new ArrayList( libraries.length );
|
||||||
|
@ -239,7 +162,7 @@ public class CSharedLibraryManager implements ICSharedLibraryManager
|
||||||
*/
|
*/
|
||||||
public void loadSymbolsForAll() throws DebugException
|
public void loadSymbolsForAll() throws DebugException
|
||||||
{
|
{
|
||||||
ICDISharedLibraryManager slm = getCDIManager();
|
ICDISharedLibraryManager slm = (ICDISharedLibraryManager)getCDIManager();
|
||||||
if ( slm != null )
|
if ( slm != null )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -9,22 +9,21 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.ICSignalManager;
|
import org.eclipse.cdt.debug.core.ICSignalManager;
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.ICDIManager;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
|
||||||
import org.eclipse.cdt.debug.core.model.ICSignal;
|
import org.eclipse.cdt.debug.core.model.ICSignal;
|
||||||
import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
|
import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
|
||||||
import org.eclipse.cdt.debug.internal.core.model.CSignal;
|
import org.eclipse.cdt.debug.internal.core.model.CSignal;
|
||||||
import org.eclipse.debug.core.DebugEvent;
|
import org.eclipse.debug.core.DebugEvent;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.core.model.IDebugTarget;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* Enter type comment.
|
||||||
*
|
*
|
||||||
* @since: Jan 31, 2003
|
* @since: Jan 31, 2003
|
||||||
*/
|
*/
|
||||||
public class CSignalManager implements ICSignalManager
|
public class CSignalManager extends CUpdateManager implements ICSignalManager
|
||||||
{
|
{
|
||||||
private CDebugTarget fDebugTarget = null;
|
|
||||||
private ICSignal[] fSignals = null;
|
private ICSignal[] fSignals = null;
|
||||||
private boolean fIsDisposed = false;
|
private boolean fIsDisposed = false;
|
||||||
|
|
||||||
|
@ -33,7 +32,7 @@ public class CSignalManager implements ICSignalManager
|
||||||
*/
|
*/
|
||||||
public CSignalManager( CDebugTarget target )
|
public CSignalManager( CDebugTarget target )
|
||||||
{
|
{
|
||||||
setDebugTarget( target );
|
super( target );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -87,21 +86,7 @@ public class CSignalManager implements ICSignalManager
|
||||||
{
|
{
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
if ( adapter.equals( IDebugTarget.class ) )
|
return super.getAdapter( adapter );
|
||||||
{
|
|
||||||
return fDebugTarget;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IDebugTarget getDebugTarget()
|
|
||||||
{
|
|
||||||
return fDebugTarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setDebugTarget( CDebugTarget target )
|
|
||||||
{
|
|
||||||
fDebugTarget = target;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void signalChanged( ICDISignal cdiSignal )
|
public void signalChanged( ICDISignal cdiSignal )
|
||||||
|
@ -132,4 +117,13 @@ public class CSignalManager implements ICSignalManager
|
||||||
{
|
{
|
||||||
return fIsDisposed;
|
return fIsDisposed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected ICDIManager getCDIManager()
|
||||||
|
{
|
||||||
|
if ( getDebugTarget() != null )
|
||||||
|
{
|
||||||
|
return ((CDebugTarget)getDebugTarget()).getCDISession().getSignalManager();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
/*
|
||||||
|
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||||
|
* All Rights Reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.eclipse.cdt.debug.internal.core;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.debug.core.ICUpdateManager;
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.ICDIManager;
|
||||||
|
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
|
||||||
|
import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
|
||||||
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
|
import org.eclipse.debug.core.DebugException;
|
||||||
|
import org.eclipse.debug.core.model.IDebugTarget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enter type comment.
|
||||||
|
*
|
||||||
|
* @since Mar 31, 2003
|
||||||
|
*/
|
||||||
|
public abstract class CUpdateManager implements ICUpdateManager, IAdaptable
|
||||||
|
{
|
||||||
|
private CDebugTarget fDebugTarget = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public CUpdateManager( CDebugTarget target )
|
||||||
|
{
|
||||||
|
fDebugTarget = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICUpdateManager#setAutoModeEnabled(boolean)
|
||||||
|
*/
|
||||||
|
public void setAutoModeEnabled( boolean enable )
|
||||||
|
{
|
||||||
|
if ( getCDIManager() != null )
|
||||||
|
{
|
||||||
|
getCDIManager().setAutoUpdate( enable );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICUpdateManager#getAutoModeEnabled()
|
||||||
|
*/
|
||||||
|
public boolean getAutoModeEnabled()
|
||||||
|
{
|
||||||
|
if ( getCDIManager() != null )
|
||||||
|
{
|
||||||
|
return getCDIManager().isAutoUpdate();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICUpdateManager#update()
|
||||||
|
*/
|
||||||
|
public void update() throws DebugException
|
||||||
|
{
|
||||||
|
if ( getCDIManager() != null )
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
getCDIManager().update();
|
||||||
|
}
|
||||||
|
catch( CDIException e )
|
||||||
|
{
|
||||||
|
((CDebugTarget)getDebugTarget()).targetRequestFailed( e.toString(), null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.ICUpdateManager#canUpdate()
|
||||||
|
*/
|
||||||
|
public boolean canUpdate()
|
||||||
|
{
|
||||||
|
if ( getDebugTarget() != null )
|
||||||
|
{
|
||||||
|
return getDebugTarget().isSuspended();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
||||||
|
*/
|
||||||
|
public Object getAdapter( Class adapter )
|
||||||
|
{
|
||||||
|
if ( ICUpdateManager.class.equals( adapter ) )
|
||||||
|
return this;
|
||||||
|
if ( IDebugTarget.class.equals( adapter ) )
|
||||||
|
return getDebugTarget();
|
||||||
|
if ( ICDebugTarget.class.equals( adapter ) )
|
||||||
|
return getDebugTarget();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CDebugTarget getDebugTarget()
|
||||||
|
{
|
||||||
|
return fDebugTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract protected ICDIManager getCDIManager();
|
||||||
|
}
|
|
@ -22,6 +22,7 @@ import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||||
import org.eclipse.cdt.debug.core.CDebugModel;
|
import org.eclipse.cdt.debug.core.CDebugModel;
|
||||||
import org.eclipse.cdt.debug.core.ICBreakpointManager;
|
import org.eclipse.cdt.debug.core.ICBreakpointManager;
|
||||||
import org.eclipse.cdt.debug.core.ICMemoryManager;
|
import org.eclipse.cdt.debug.core.ICMemoryManager;
|
||||||
|
import org.eclipse.cdt.debug.core.ICRegisterManager;
|
||||||
import org.eclipse.cdt.debug.core.ICSharedLibraryManager;
|
import org.eclipse.cdt.debug.core.ICSharedLibraryManager;
|
||||||
import org.eclipse.cdt.debug.core.ICSignalManager;
|
import org.eclipse.cdt.debug.core.ICSignalManager;
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
|
@ -50,7 +51,6 @@ import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
||||||
|
@ -75,6 +75,7 @@ import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator;
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.ISourceMode;
|
import org.eclipse.cdt.debug.core.sourcelookup.ISourceMode;
|
||||||
import org.eclipse.cdt.debug.internal.core.CDebugUtils;
|
import org.eclipse.cdt.debug.internal.core.CDebugUtils;
|
||||||
import org.eclipse.cdt.debug.internal.core.CMemoryManager;
|
import org.eclipse.cdt.debug.internal.core.CMemoryManager;
|
||||||
|
import org.eclipse.cdt.debug.internal.core.CRegisterManager;
|
||||||
import org.eclipse.cdt.debug.internal.core.CSharedLibraryManager;
|
import org.eclipse.cdt.debug.internal.core.CSharedLibraryManager;
|
||||||
import org.eclipse.cdt.debug.internal.core.CSignalManager;
|
import org.eclipse.cdt.debug.internal.core.CSignalManager;
|
||||||
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
|
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
|
||||||
|
@ -213,11 +214,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
*/
|
*/
|
||||||
private HashMap fBreakpoints;
|
private HashMap fBreakpoints;
|
||||||
|
|
||||||
/**
|
|
||||||
* Collection of register groups added to this target. Values are of type <code>CRegisterGroup</code>.
|
|
||||||
*/
|
|
||||||
private List fRegisterGroups;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A memory manager for this target.
|
* A memory manager for this target.
|
||||||
*/
|
*/
|
||||||
|
@ -238,6 +234,11 @@ public class CDebugTarget extends CDebugElement
|
||||||
*/
|
*/
|
||||||
private CSignalManager fSignalManager;
|
private CSignalManager fSignalManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A register manager for this target.
|
||||||
|
*/
|
||||||
|
private CRegisterManager fRegisterManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the debugger process is default.
|
* Whether the debugger process is default.
|
||||||
*/
|
*/
|
||||||
|
@ -284,6 +285,7 @@ public class CDebugTarget extends CDebugElement
|
||||||
setDisassemblyManager( new DisassemblyManager( this ) );
|
setDisassemblyManager( new DisassemblyManager( this ) );
|
||||||
setSharedLibraryManager( new CSharedLibraryManager( this ) );
|
setSharedLibraryManager( new CSharedLibraryManager( this ) );
|
||||||
setSignalManager( new CSignalManager( this ) );
|
setSignalManager( new CSignalManager( this ) );
|
||||||
|
setRegisterManager( new CRegisterManager( this ) );
|
||||||
initialize();
|
initialize();
|
||||||
DebugPlugin.getDefault().getLaunchManager().addLaunchListener( this );
|
DebugPlugin.getDefault().getLaunchManager().addLaunchListener( this );
|
||||||
DebugPlugin.getDefault().getExpressionManager().addExpressionListener( this );
|
DebugPlugin.getDefault().getExpressionManager().addExpressionListener( this );
|
||||||
|
@ -387,8 +389,7 @@ public class CDebugTarget extends CDebugElement
|
||||||
|
|
||||||
protected void initializeRegisters()
|
protected void initializeRegisters()
|
||||||
{
|
{
|
||||||
fRegisterGroups = new ArrayList( 20 );
|
getRegisterManager().initialize();
|
||||||
createMainRegisterGroup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initializeMemoryManager()
|
protected void initializeMemoryManager()
|
||||||
|
@ -931,6 +932,8 @@ public class CDebugTarget extends CDebugElement
|
||||||
return getSharedLibraryManager();
|
return getSharedLibraryManager();
|
||||||
if ( adapter.equals( ICSignalManager.class ) )
|
if ( adapter.equals( ICSignalManager.class ) )
|
||||||
return getSignalManager();
|
return getSignalManager();
|
||||||
|
if ( adapter.equals( ICRegisterManager.class ) )
|
||||||
|
return getRegisterManager();
|
||||||
return super.getAdapter( adapter );
|
return super.getAdapter( adapter );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1175,7 +1178,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
protected void cleanup()
|
protected void cleanup()
|
||||||
{
|
{
|
||||||
removeAllThreads();
|
removeAllThreads();
|
||||||
removeAllRegisterGroups();
|
|
||||||
getCDISession().getEventManager().removeEventListener( this );
|
getCDISession().getEventManager().removeEventListener( this );
|
||||||
DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener( this );
|
DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener( this );
|
||||||
DebugPlugin.getDefault().getExpressionManager().removeExpressionListener( this );
|
DebugPlugin.getDefault().getExpressionManager().removeExpressionListener( this );
|
||||||
|
@ -1183,6 +1185,7 @@ public class CDebugTarget extends CDebugElement
|
||||||
disposeMemoryManager();
|
disposeMemoryManager();
|
||||||
disposeSharedLibraryManager();
|
disposeSharedLibraryManager();
|
||||||
disposeSignalManager();
|
disposeSignalManager();
|
||||||
|
disposeRegisterManager();
|
||||||
removeAllExpressions();
|
removeAllExpressions();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -2017,42 +2020,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
return isAvailable() && isSuspended();
|
return isAvailable() && isSuspended();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IRegisterGroup[] getRegisterGroups() throws DebugException
|
|
||||||
{
|
|
||||||
return (IRegisterGroup[])fRegisterGroups.toArray( new IRegisterGroup[fRegisterGroups.size()] );
|
|
||||||
}
|
|
||||||
|
|
||||||
protected IRegisterGroup[] getRegisterGroups( CStackFrame stackFrame ) throws DebugException
|
|
||||||
{
|
|
||||||
return (IRegisterGroup[])fRegisterGroups.toArray( new IRegisterGroup[fRegisterGroups.size()] );
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void createMainRegisterGroup()
|
|
||||||
{
|
|
||||||
ICDIRegisterObject[] regObjects = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
regObjects = getCDISession().getRegisterManager().getRegisterObjects();
|
|
||||||
}
|
|
||||||
catch( CDIException e )
|
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( e );
|
|
||||||
}
|
|
||||||
if ( regObjects != null )
|
|
||||||
{
|
|
||||||
fRegisterGroups.add( new CRegisterGroup( this, "Main", regObjects ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void removeAllRegisterGroups()
|
|
||||||
{
|
|
||||||
Iterator it = fRegisterGroups.iterator();
|
|
||||||
while( it.hasNext() )
|
|
||||||
{
|
|
||||||
((CRegisterGroup)it.next()).dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.debug.core.IExpressionListener#expressionAdded(IExpression)
|
* @see org.eclipse.debug.core.IExpressionListener#expressionAdded(IExpression)
|
||||||
*/
|
*/
|
||||||
|
@ -2194,11 +2161,7 @@ public class CDebugTarget extends CDebugElement
|
||||||
|
|
||||||
protected void resetRegisters()
|
protected void resetRegisters()
|
||||||
{
|
{
|
||||||
Iterator it = fRegisterGroups.iterator();
|
getRegisterManager().reset();
|
||||||
while( it.hasNext() )
|
|
||||||
{
|
|
||||||
((CRegisterGroup)it.next()).resetChangeFlags();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2395,6 +2358,11 @@ public class CDebugTarget extends CDebugElement
|
||||||
fSignalManager.dispose();
|
fSignalManager.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void disposeRegisterManager()
|
||||||
|
{
|
||||||
|
fRegisterManager.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.debug.core.ICBreakpointManager#getBreakpointAddress(IBreakpoint)
|
* @see org.eclipse.cdt.debug.core.ICBreakpointManager#getBreakpointAddress(IBreakpoint)
|
||||||
*/
|
*/
|
||||||
|
@ -2554,4 +2522,19 @@ public class CDebugTarget extends CDebugElement
|
||||||
targetRequestFailed( e.toString(), e );
|
targetRequestFailed( e.toString(), e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CRegisterManager getRegisterManager()
|
||||||
|
{
|
||||||
|
return fRegisterManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setRegisterManager( CRegisterManager registerManager )
|
||||||
|
{
|
||||||
|
fRegisterManager = registerManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IRegisterGroup[] getRegisterGroups() throws DebugException
|
||||||
|
{
|
||||||
|
return getRegisterManager().getRegisterGroups();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class CRegisterGroup extends CDebugElement implements IRegisterGroup
|
||||||
return fRegisters;
|
return fRegisters;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
Iterator it = fRegisters.iterator();
|
Iterator it = fRegisters.iterator();
|
||||||
while( it.hasNext() )
|
while( it.hasNext() )
|
||||||
|
@ -107,7 +107,7 @@ public class CRegisterGroup extends CDebugElement implements IRegisterGroup
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void resetChangeFlags()
|
public void resetChangeFlags()
|
||||||
{
|
{
|
||||||
if ( fRegisters == null )
|
if ( fRegisters == null )
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue