1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +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
Removed "Refresh" and "Auto-Refresh" actions support for registers.
* 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$
/**
* 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.
*/

View file

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

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