1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Bug 82264: Enhance the Shared Libraries view. Support for the symbols loading operations.

This commit is contained in:
Mikhail Khodjaiants 2005-02-15 03:07:21 +00:00
parent 9f7e8208ec
commit 31ac25cbd5
4 changed files with 64 additions and 10 deletions

View file

@ -1,3 +1,10 @@
2005-02-14 Mikhail Khodjaiants
Bug 82264: Enhance the Shared Libraries view.
Support for the symbols loading operations.
* ICModule.java
* CModule.java
* CoreModelMessages.properties
2005-02-11 Mikhail Khodjaiants 2005-02-11 Mikhail Khodjaiants
Bug 82264: Enhance the Shared Libraries view. Bug 82264: Enhance the Shared Libraries view.
Added new "getCPU" method to ICModule. Added new "getCPU" method to ICModule.

View file

@ -17,6 +17,8 @@ import org.eclipse.debug.core.DebugException;
/** /**
* Represents a module in the process being debugged. * Represents a module in the process being debugged.
*
* @since 3.0
*/ */
public interface ICModule extends ICDebugElement { public interface ICModule extends ICDebugElement {
@ -72,8 +74,9 @@ public interface ICModule extends ICDebugElement {
* search mechanism will be used. * search mechanism will be used.
* *
* @param symbolsFile the symbol provider for this module. * @param symbolsFile the symbol provider for this module.
* @throws DebugException if this method fails. Reasons include:
*/ */
public void setSymbolsFileName( IPath symbolsFile ); public void setSymbolsFileName( IPath symbolsFile ) throws DebugException;
/** /**
* Returns the base address of this module. * Returns the base address of this module.
@ -96,6 +99,13 @@ public interface ICModule extends ICDebugElement {
*/ */
public boolean areSymbolsLoaded(); public boolean areSymbolsLoaded();
/**
* Returns whether the module's symbols can be loaded or reloaded.
*
* @return whether the module's symbols can be loaded or reloaded
*/
public boolean canLoadSymbols();
/** /**
* Loads the module symbols from the specified file. * Loads the module symbols from the specified file.
* *
@ -130,4 +140,11 @@ public interface ICModule extends ICDebugElement {
* @return the CPU identifier * @return the CPU identifier
*/ */
public String getCPU(); public String getCPU();
/**
* Returns whether the symbols of this module can be loaded from another file.
*
* @return whether the symbols of this module can be loaded from another file
*/
public boolean canModifySymbolsSource();
} }

View file

@ -10,7 +10,9 @@
***********************************************************************/ ***********************************************************************/
package org.eclipse.cdt.debug.internal.core.model; package org.eclipse.cdt.debug.internal.core.model;
import java.io.File;
import java.math.BigInteger; import java.math.BigInteger;
import java.text.MessageFormat;
import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.IAddress;
import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.core.IAddressFactory;
import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.CoreModel;
@ -109,7 +111,8 @@ public class CModule extends CDebugElement implements ICModule {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICModule#setSymbolsFileName(org.eclipse.core.runtime.IPath) * @see org.eclipse.cdt.debug.core.model.ICModule#setSymbolsFileName(org.eclipse.core.runtime.IPath)
*/ */
public void setSymbolsFileName( IPath symbolsFile ) { public void setSymbolsFileName( IPath symbolsFile ) throws DebugException {
loadSymbolsFromFile( symbolsFile );
fSymbolsFileName = symbolsFile; fSymbolsFileName = symbolsFile;
} }
@ -142,12 +145,18 @@ public class CModule extends CDebugElement implements ICModule {
( ( fCDIObject instanceof ICDISharedLibrary ) ? ((ICDISharedLibrary)fCDIObject).areSymbolsLoaded() : false ); ( ( fCDIObject instanceof ICDISharedLibrary ) ? ((ICDISharedLibrary)fCDIObject).areSymbolsLoaded() : false );
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICModule#canLoadSymbols()
*/
public boolean canLoadSymbols() {
return ( getDebugTarget().isSuspended() && (canModifySymbolsSource() || !areSymbolsLoaded()) );
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICModule#loadSymbols() * @see org.eclipse.cdt.debug.core.model.ICModule#loadSymbols()
*/ */
public void loadSymbols() throws DebugException { public void loadSymbols() throws DebugException {
// TODO Auto-generated method stub loadSymbolsFromFile( getSymbolsFileName() );
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -178,12 +187,11 @@ public class CModule extends CDebugElement implements ICModule {
return ( fCElement instanceof IBinary ) ? ((IBinary)fCElement).getCPU() : null; return ( fCElement instanceof IBinary ) ? ((IBinary)fCElement).getCPU() : null;
} }
public void dispose() { /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICModule#canModifySymbolsSource()
} */
public boolean canModifySymbolsSource() {
public boolean equals( ICDIObject cdiObject ) { return true;
return ( fCDIObject != null ) ? fCDIObject.equals( cdiObject ) : false;
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -199,7 +207,26 @@ public class CModule extends CDebugElement implements ICModule {
return super.getAdapter( adapter ); return super.getAdapter( adapter );
} }
public void dispose() {
}
public boolean equals( ICDIObject cdiObject ) {
return ( fCDIObject != null ) ? fCDIObject.equals( cdiObject ) : false;
}
protected ICElement getCElement() { protected ICElement getCElement() {
return fCElement; return fCElement;
} }
private void loadSymbolsFromFile( IPath path ) throws DebugException {
if ( path == null || path.isEmpty() ) {
requestFailed( CoreModelMessages.getString( "CModule.2" ), null ); //$NON-NLS-1$
}
File file = new File( path.toOSString() );
if ( !file.exists() ) {
requestFailed( MessageFormat.format( CoreModelMessages.getString( "CModule.3" ), new String[] { path.toOSString() } ), null ); //$NON-NLS-1$
}
targetRequestFailed( CoreModelMessages.getString( "CModule.4" ), null ); //$NON-NLS-1$
}
} }

View file

@ -29,5 +29,8 @@ CIndexedValue.1=Index out of bounds.
CIndexedValue.2=Specified range out of bounds. CIndexedValue.2=Specified range out of bounds.
CModule.0=Unknown CModule.0=Unknown
CModule.1=Unknown CModule.1=Unknown
CModule.2=Invalid symbols file.
CModule.3=Symbols file ''{0}'' not found.
CModule.4=Not supported
CModuleManager.0=Error loading symbols. CModuleManager.0=Error loading symbols.
CModuleManager.1=Error loading symbols. CModuleManager.1=Error loading symbols.