1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Removed "Refresh" and "Auto-Refresh" actions support for shared libraries.

This commit is contained in:
Mikhail Khodjaiants 2004-11-04 22:47:49 +00:00
parent c9259b653d
commit a740df2852
6 changed files with 56 additions and 242 deletions

View file

@ -1,3 +1,11 @@
2004-11-04 Mikhail Khodjaiants
Removed "Refresh" and "Auto-Refresh" actions support for shared libraries.
* ICDebugConstants.java
* ICSharedLibraryManager.java
* CSharedLibraryManager.java
* ICUpdateManager.java: removed
* CUpdateManager.java: removed
2004-11-04 Mikhail Khodjaiants 2004-11-04 Mikhail Khodjaiants
Removed "Refresh" and "Auto-Refresh" actions support for registers. Removed "Refresh" and "Auto-Refresh" actions support for registers.
* ICDebugConstants.java * ICDebugConstants.java

View file

@ -38,12 +38,6 @@ public interface ICDebugConstants
*/ */
public static final String PREF_DEFAULT_EXPRESSION_FORMAT = PLUGIN_ID + "cDebug.default_expression_format"; //$NON-NLS-1$ public static final String PREF_DEFAULT_EXPRESSION_FORMAT = PLUGIN_ID + "cDebug.default_expression_format"; //$NON-NLS-1$
/**
* Boolean preference controlling whether the shared library manager will be
* refreshed every time when the execution of program stops.
*/
public static final String PREF_SHARED_LIBRARIES_AUTO_REFRESH = PLUGIN_ID + "SharedLibraries.auto_refresh"; //$NON-NLS-1$
/** /**
* The identifier of the maximum number of instructions displayed in disassembly. * The identifier of the maximum number of instructions displayed in disassembly.
*/ */

View file

@ -15,12 +15,10 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
/** /**
* Enter type comment. * Provides the access to the shared libraries' management functions.
*
* @since: Jan 15, 2003
*/ */
public interface ICSharedLibraryManager extends ICUpdateManager, IAdaptable public interface ICSharedLibraryManager extends IAdaptable {
{
ICSharedLibrary[] getSharedLibraries(); ICSharedLibrary[] getSharedLibraries();
void loadSymbolsForAll() throws DebugException; void loadSymbolsForAll() throws DebugException;

View file

@ -1,27 +0,0 @@
/**********************************************************************
* Copyright (c) 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.core;
import org.eclipse.debug.core.DebugException;
/**
* Indicates the support of update and auto-update functions.
*/
public interface ICUpdateManager {
void setAutoModeEnabled( boolean enable );
boolean getAutoModeEnabled();
void update() throws DebugException;
boolean canUpdate();
}

View file

@ -12,12 +12,8 @@ package org.eclipse.cdt.debug.internal.core;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICDebugConstants;
import org.eclipse.cdt.debug.core.ICSharedLibraryManager; import org.eclipse.cdt.debug.core.ICSharedLibraryManager;
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.ICDISharedLibrary; import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.model.ICSharedLibrary; import org.eclipse.cdt.debug.core.model.ICSharedLibrary;
@ -28,31 +24,29 @@ import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
/** /**
* Enter type comment. * Manages the collection of the shared libraries loaded on a debug target.
*
* @since: Jan 16, 2003
*/ */
public class CSharedLibraryManager extends CUpdateManager implements ICSharedLibraryManager public class CSharedLibraryManager implements ICSharedLibraryManager {
{
/**
* The debug target associated with this manager.
*/
private CDebugTarget fDebugTarget;
/**
* The collection of the shared libraries loaded on this target.
*/
private ArrayList fSharedLibraries; private ArrayList fSharedLibraries;
/** /**
* Constructor for CSharedLibraryManager. * Constructor for CSharedLibraryManager.
*/ */
public CSharedLibraryManager( CDebugTarget target ) public CSharedLibraryManager( CDebugTarget target ) {
{ fDebugTarget = target;
super( target );
fSharedLibraries = new ArrayList( 5 ); fSharedLibraries = new ArrayList( 5 );
boolean autoRefresh = CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH );
if ( getCDIManager() != null )
getCDIManager().setAutoUpdate( autoRefresh );
} }
/* (non-Javadoc) public void sharedLibraryLoaded( ICDISharedLibrary cdiLibrary ) {
* @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#sharedLibararyLoaded(ICDISharedLibrary)
*/
public void sharedLibraryLoaded( ICDISharedLibrary cdiLibrary )
{
CSharedLibrary library = new CSharedLibrary( getDebugTarget(), cdiLibrary ); CSharedLibrary library = new CSharedLibrary( getDebugTarget(), cdiLibrary );
synchronized( fSharedLibraries ) { synchronized( fSharedLibraries ) {
fSharedLibraries.add( library ); fSharedLibraries.add( library );
@ -62,14 +56,9 @@ public class CSharedLibraryManager extends CUpdateManager implements ICSharedLib
setBreakpoints(); setBreakpoints();
} }
/* (non-Javadoc) public synchronized void sharedLibraryUnloaded( ICDISharedLibrary cdiLibrary ) {
* @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#sharedLibraryUnloaded(ICDISharedLibrary)
*/
public synchronized void sharedLibraryUnloaded( ICDISharedLibrary cdiLibrary )
{
CSharedLibrary library = find( cdiLibrary ); CSharedLibrary library = find( cdiLibrary );
if ( library != null ) if ( library != null ) {
{
synchronized( fSharedLibraries ) { synchronized( fSharedLibraries ) {
fSharedLibraries.remove( library ); fSharedLibraries.remove( library );
} }
@ -78,14 +67,9 @@ public class CSharedLibraryManager extends CUpdateManager implements ICSharedLib
} }
} }
/* (non-Javadoc) public void symbolsLoaded( ICDISharedLibrary cdiLibrary ) {
* @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#symbolsLoaded(ICDISharedLibrary)
*/
public void symbolsLoaded( ICDISharedLibrary cdiLibrary )
{
CSharedLibrary library = find( cdiLibrary ); CSharedLibrary library = find( cdiLibrary );
if ( library != null ) if ( library != null ) {
{
library.fireChangeEvent( DebugEvent.STATE ); library.fireChangeEvent( DebugEvent.STATE );
setBreakpoints(); setBreakpoints();
} }
@ -94,46 +78,37 @@ public class CSharedLibraryManager extends CUpdateManager implements ICSharedLib
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#getSharedLibraries() * @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#getSharedLibraries()
*/ */
public ICSharedLibrary[] getSharedLibraries() public ICSharedLibrary[] getSharedLibraries() {
{
return (ICSharedLibrary[])fSharedLibraries.toArray( new ICSharedLibrary[fSharedLibraries.size()] ); return (ICSharedLibrary[])fSharedLibraries.toArray( new ICSharedLibrary[fSharedLibraries.size()] );
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#dispose() * @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#dispose()
*/ */
public void dispose() public void dispose() {
{
Iterator it = fSharedLibraries.iterator(); Iterator it = fSharedLibraries.iterator();
while( it.hasNext() ) while( it.hasNext() ) {
{
((CSharedLibrary)it.next()).dispose(); ((CSharedLibrary)it.next()).dispose();
} }
fSharedLibraries.clear(); fSharedLibraries.clear();
super.dispose();
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
public Object getAdapter( Class adapter ) public Object getAdapter( Class adapter ) {
{ if ( adapter.equals( ICSharedLibraryManager.class ) ) {
if ( adapter.equals( ICSharedLibraryManager.class ) )
{
return this; return this;
} }
if ( adapter.equals( CSharedLibraryManager.class ) ) if ( adapter.equals( CSharedLibraryManager.class ) ) {
{
return this; return this;
} }
return super.getAdapter( adapter ); return null;
} }
protected CSharedLibrary find( ICDISharedLibrary cdiLibrary ) protected CSharedLibrary find( ICDISharedLibrary cdiLibrary ) {
{
Iterator it = fSharedLibraries.iterator(); Iterator it = fSharedLibraries.iterator();
while( it.hasNext() ) while( it.hasNext() ) {
{
CSharedLibrary library = (CSharedLibrary)it.next(); CSharedLibrary library = (CSharedLibrary)it.next();
if ( library.getCDISharedLibrary().equals( cdiLibrary ) ) if ( library.getCDISharedLibrary().equals( cdiLibrary ) )
return library; return library;
@ -141,24 +116,15 @@ public class CSharedLibraryManager extends CUpdateManager implements ICSharedLib
return null; return null;
} }
protected ICDIManager getCDIManager()
{
return null;
}
/* (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 {
{ for( int i = 0; i < libraries.length; ++i ) {
for (int i = 0; i < libraries.length; ++i) try {
{
try
{
((CSharedLibrary)libraries[i]).getCDISharedLibrary().loadSymbols(); ((CSharedLibrary)libraries[i]).getCDISharedLibrary().loadSymbols();
} }
catch ( CDIException e ) catch( CDIException e ) {
{
CDebugElement.targetRequestFailed( e.getMessage(), null ); CDebugElement.targetRequestFailed( e.getMessage(), null );
} }
} }
@ -167,25 +133,24 @@ public class CSharedLibraryManager extends CUpdateManager implements ICSharedLib
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#loadSymbolsForAll() * @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#loadSymbolsForAll()
*/ */
public void loadSymbolsForAll() throws DebugException public void loadSymbolsForAll() throws DebugException {
{
ICDITarget target = getDebugTarget().getCDITarget(); ICDITarget target = getDebugTarget().getCDITarget();
try try {
{
ICDISharedLibrary[] libraries = target.getSharedLibraries(); ICDISharedLibrary[] libraries = target.getSharedLibraries();
for (int i = 0; i < libraries.length; ++i) for( int i = 0; i < libraries.length; ++i ) {
{
libraries[i].loadSymbols(); libraries[i].loadSymbols();
} }
} }
catch ( CDIException e ) catch( CDIException e ) {
{
CDebugElement.targetRequestFailed( e.getMessage(), null ); CDebugElement.targetRequestFailed( e.getMessage(), null );
} }
} }
private void setBreakpoints() private void setBreakpoints() {
{
getDebugTarget().setBreakpoints(); getDebugTarget().setBreakpoints();
} }
protected CDebugTarget getDebugTarget() {
return fDebugTarget;
}
} }

View file

@ -1,124 +0,0 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.internal.core;
import java.util.Observable;
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.CDebugElement;
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 extends Observable 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 );
setChanged();
notifyObservers();
clearChanged();
}
}
/* (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 )
{
CDebugElement.targetRequestFailed( e.getMessage(), 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();
if ( Observable.class.equals( adapter ) )
return this;
return null;
}
public CDebugTarget getDebugTarget()
{
return fDebugTarget;
}
public void dispose() {
deleteObservers();
}
abstract protected ICDIManager getCDIManager();
}