1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

Bug 82264: Enhance the Shared Libraries view. Removed the core support of theShared Libraries view.

This commit is contained in:
Mikhail Khodjaiants 2005-02-18 19:55:33 +00:00
parent 2aae3af85f
commit fac0ffa530
7 changed files with 10 additions and 438 deletions

View file

@ -1,3 +1,13 @@
2005-02-17 Mikhail Khodjaiants
Bug 82264: Enhance the Shared Libraries view.
Removed the core support of theShared Libraries view.
* ICSharedLibraryManager.java: removed
* ICDebugTarget.java
* ICSharedLibrary.java: removed
* CSharedLibraryManager.java; removed
* CDebugTarget.java
* CSharedLibrary.java: removed
2005-02-16 Mikhail Khodjaiants
Bug 82264: Enhance the Shared Libraries view.
Cleanup of the ICModule interface.

View file

@ -1,29 +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.core;
import org.eclipse.cdt.debug.core.model.ICSharedLibrary;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.core.DebugException;
/**
* Provides the access to the shared libraries' management functions.
*/
public interface ICSharedLibraryManager extends IAdaptable {
ICSharedLibrary[] getSharedLibraries();
void loadSymbolsForAll() throws DebugException;
void loadSymbols( ICSharedLibrary[] libraries ) throws DebugException;
void dispose();
}

View file

@ -29,32 +29,6 @@ public interface ICDebugTarget extends IDebugTarget,
ISteppingModeTarget,
ITargetProperties {
/**
* Returns the shared libraries loaded in this debug target. An
* empty collection is returned if no shared libraries are loaded.
*
* @return a collection of shred libraries
*
* @throws DebugException
*/
public ICSharedLibrary[] getSharedLibraries() throws DebugException;
/**
* Returns whether there are shared libraries currently loaded in this debug target.
*
* @return whether there are shared libraries currently loaded in this debug target
*
* @throws DebugException
*/
public boolean hasSharedLibraries() throws DebugException;
/**
* Load the symbols of all shared objects.
*
* @throws DebugException
*/
public void loadSymbols() throws DebugException;
/**
* Returns whether this target is little endian.
*

View file

@ -1,56 +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.model;
import org.eclipse.cdt.core.IAddress;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IDebugElement;
/**
* Represents a shared library.
*/
public interface ICSharedLibrary extends IDebugElement {
/**
* Returns the name of shared library file.
*
* @return the name of shared library file
*/
String getFileName();
/**
* Returns the start address of this library.
*
* @return the start address of this library
*/
IAddress getStartAddress();
/**
* Returns the end address of this library.
*
* @return the end address of this library
*/
IAddress getEndAddress();
/**
* Returns whether the symbols of this library are read.
*
* @return whether the symbols of this library are read
*/
boolean areSymbolsLoaded();
/**
* Loads the library symbols.
*
* @throws DebugException if this method fails. Reasons include:
*/
void loadSymbols() throws DebugException;
}

View file

@ -1,149 +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.ArrayList;
import java.util.Iterator;
import org.eclipse.cdt.debug.core.ICSharedLibraryManager;
import org.eclipse.cdt.debug.core.cdi.CDIException;
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;
import org.eclipse.cdt.debug.internal.core.model.CDebugElement;
import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
import org.eclipse.cdt.debug.internal.core.model.CSharedLibrary;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
/**
* Manages the collection of the shared libraries loaded on a debug target.
*/
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 ) {
fDebugTarget = target;
fSharedLibraries = new ArrayList( 5 );
}
public void sharedLibraryLoaded( ICDISharedLibrary cdiLibrary ) {
CSharedLibrary library = new CSharedLibrary( getDebugTarget(), cdiLibrary );
synchronized( fSharedLibraries ) {
fSharedLibraries.add( library );
}
library.fireCreationEvent();
}
public synchronized void sharedLibraryUnloaded( ICDISharedLibrary cdiLibrary ) {
CSharedLibrary library = find( cdiLibrary );
if ( library != null ) {
synchronized( fSharedLibraries ) {
fSharedLibraries.remove( library );
}
library.dispose();
library.fireTerminateEvent();
}
}
public void symbolsLoaded( ICDISharedLibrary cdiLibrary ) {
CSharedLibrary library = find( cdiLibrary );
if ( library != null ) {
library.fireChangeEvent( DebugEvent.STATE );
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#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() {
Iterator it = fSharedLibraries.iterator();
while( it.hasNext() ) {
((CSharedLibrary)it.next()).dispose();
}
fSharedLibraries.clear();
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
public Object getAdapter( Class adapter ) {
if ( adapter.equals( ICSharedLibraryManager.class ) ) {
return this;
}
if ( adapter.equals( CSharedLibraryManager.class ) ) {
return this;
}
return null;
}
protected CSharedLibrary find( ICDISharedLibrary cdiLibrary ) {
Iterator it = fSharedLibraries.iterator();
while( it.hasNext() ) {
CSharedLibrary library = (CSharedLibrary)it.next();
if ( library.getCDISharedLibrary().equals( cdiLibrary ) )
return library;
}
return null;
}
/* (non-Javadoc)
* @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 {
((CSharedLibrary)libraries[i]).getCDISharedLibrary().loadSymbols();
}
catch( CDIException e ) {
CDebugElement.targetRequestFailed( e.getMessage(), null );
}
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#loadSymbolsForAll()
*/
public void loadSymbolsForAll() throws DebugException {
ICDITarget target = getDebugTarget().getCDITarget();
try {
ICDISharedLibrary[] libraries = target.getSharedLibraries();
for( int i = 0; i < libraries.length; ++i ) {
libraries[i].loadSymbols();
}
}
catch( CDIException e ) {
CDebugElement.targetRequestFailed( e.getMessage(), null );
}
}
protected CDebugTarget getDebugTarget() {
return fDebugTarget;
}
}

View file

@ -26,7 +26,6 @@ import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.ICGlobalVariableManager;
import org.eclipse.cdt.debug.core.ICRegisterManager;
import org.eclipse.cdt.debug.core.ICSharedLibraryManager;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit;
import org.eclipse.cdt.debug.core.cdi.ICDIEndSteppingRange;
@ -67,7 +66,6 @@ import org.eclipse.cdt.debug.core.model.ICDebugTarget;
import org.eclipse.cdt.debug.core.model.ICGlobalVariable;
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
import org.eclipse.cdt.debug.core.model.ICModule;
import org.eclipse.cdt.debug.core.model.ICSharedLibrary;
import org.eclipse.cdt.debug.core.model.ICSignal;
import org.eclipse.cdt.debug.core.model.IDebuggerProcessSupport;
import org.eclipse.cdt.debug.core.model.IDisassembly;
@ -82,7 +80,6 @@ import org.eclipse.cdt.debug.internal.core.CBreakpointManager;
import org.eclipse.cdt.debug.internal.core.CGlobalVariableManager;
import org.eclipse.cdt.debug.internal.core.CMemoryBlockExtensionRetrieval;
import org.eclipse.cdt.debug.internal.core.CRegisterManager;
import org.eclipse.cdt.debug.internal.core.CSharedLibraryManager;
import org.eclipse.cdt.debug.internal.core.CSignalManager;
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceManager;
@ -158,11 +155,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
*/
private Disassembly fDisassembly;
/**
* The shared library manager for this target.
*/
private CSharedLibraryManager fSharedLibraryManager;
/**
* The module manager for this target.
*/
@ -235,7 +227,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
setConfiguration( cdiTarget.getConfiguration() );
setThreadList( new ArrayList( 5 ) );
createDisassembly();
setSharedLibraryManager( new CSharedLibraryManager( this ) );
setModuleManager( new CModuleManager( this ) );
setSignalManager( new CSignalManager( this ) );
setRegisterManager( new CRegisterManager( this ) );
@ -840,7 +831,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
handleThreadCreatedEvent( (ICDICreatedEvent)event );
}
if ( source instanceof ICDISharedLibrary ) {
getSharedLibraryManager().sharedLibraryLoaded( (ICDISharedLibrary)source );
getModuleManager().sharedLibraryLoaded( (ICDISharedLibrary)source );
}
}
@ -864,7 +854,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
handleThreadTerminatedEvent( (ICDIDestroyedEvent)event );
}
if ( source instanceof ICDISharedLibrary ) {
getSharedLibraryManager().sharedLibraryUnloaded( (ICDISharedLibrary)source );
getModuleManager().sharedLibraryUnloaded( (ICDISharedLibrary)source );
}
}
@ -982,7 +971,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener( this );
saveGlobalVariables();
disposeGlobalVariableManager();
disposeSharedLibraryManager();
disposeModuleManager();
disposeSignalManager();
disposeRegisterManager();
@ -1400,18 +1388,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
return list;
}
protected void setSharedLibraryManager( CSharedLibraryManager libman ) {
fSharedLibraryManager = libman;
}
protected CSharedLibraryManager getSharedLibraryManager() {
return fSharedLibraryManager;
}
protected void disposeSharedLibraryManager() {
fSharedLibraryManager.dispose();
}
protected void setModuleManager( CModuleManager mm ) {
fModuleManager = mm;
}
@ -1629,17 +1605,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
return fDisassembly;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICDebugTarget#getSharedLibraries()
*/
public ICSharedLibrary[] getSharedLibraries() throws DebugException {
ICSharedLibraryManager slm = getSharedLibraryManager();
if ( slm != null ) {
return slm.getSharedLibraries();
}
return new ICSharedLibrary[0];
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICDebugTarget#getSignals()
*/
@ -1651,17 +1616,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
return new ICSignal[0];
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICDebugTarget#hasSharedLibraries()
*/
public boolean hasSharedLibraries() throws DebugException {
ICSharedLibraryManager slm = getSharedLibraryManager();
if ( slm != null ) {
return (slm.getSharedLibraries().length > 0);
}
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICDebugTarget#hasSignals()
*/
@ -1673,16 +1627,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICDebugTarget#loadSymbols()
*/
public void loadSymbols() throws DebugException {
ICSharedLibraryManager slm = getSharedLibraryManager();
if ( slm != null ) {
slm.loadSymbolsForAll();
}
}
private void createDisassembly() {
this.fDisassembly = new Disassembly( this );
}
@ -1806,7 +1750,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
}
private void handleSymbolsLoaded( ICDISharedLibrary library ) {
getSharedLibraryManager().symbolsLoaded( library );
getModuleManager().symbolsLoaded( library );
}

View file

@ -1,121 +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.model;
import org.eclipse.cdt.core.IAddress;
import org.eclipse.cdt.core.IAddressFactory;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
import org.eclipse.cdt.debug.core.model.ICSharedLibrary;
import org.eclipse.debug.core.DebugException;
/**
* Enter type comment.
*
* @since: Jan 16, 2003
*/
public class CSharedLibrary extends CDebugElement
implements ICSharedLibrary,
ICDIEventListener
{
private ICDISharedLibrary fCDILib = null;
/**
* Constructor for CSharedLibrary.
* @param target
*/
public CSharedLibrary( CDebugTarget target, ICDISharedLibrary cdiLib )
{
super( target );
fCDILib = cdiLib;
getCDISession().getEventManager().addEventListener( this );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getFileName()
*/
public String getFileName()
{
if ( getCDISharedLibrary() != null )
return getCDISharedLibrary().getFileName();
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getStartAddress()
*/
public IAddress getStartAddress()
{
IAddressFactory factory = ((CDebugTarget)getDebugTarget()).getAddressFactory();
if ( getCDISharedLibrary() != null )
return factory.createAddress( getCDISharedLibrary().getStartAddress() );
return factory.getZero();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getEndAddress()
*/
public IAddress getEndAddress()
{
IAddressFactory factory = ((CDebugTarget)getDebugTarget()).getAddressFactory();
if ( getCDISharedLibrary() != null )
return factory.createAddress( getCDISharedLibrary().getEndAddress() );
return factory.getZero();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#areSymbolsLoaded()
*/
public boolean areSymbolsLoaded()
{
if ( getCDISharedLibrary() != null )
return getCDISharedLibrary().areSymbolsLoaded();
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#loadSymbols()
*/
public void loadSymbols() throws DebugException
{
try
{
if ( getCDISharedLibrary() != null )
getCDISharedLibrary().loadSymbols();
}
catch( CDIException e )
{
targetRequestFailed( e.getMessage(), null );
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#dispose()
*/
public void dispose()
{
getCDISession().getEventManager().removeEventListener( this );
}
public ICDISharedLibrary getCDISharedLibrary()
{
return fCDILib;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(ICDIEvent)
*/
public void handleDebugEvents( ICDIEvent[] events )
{
}
}