mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 22:22:11 +02:00
Bug 82264: Enhance the Shared Libraries view. Support for the symbols loading operations.
This commit is contained in:
parent
9f7e8208ec
commit
31ac25cbd5
4 changed files with 64 additions and 10 deletions
|
@ -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
|
||||
Bug 82264: Enhance the Shared Libraries view.
|
||||
Added new "getCPU" method to ICModule.
|
||||
|
|
|
@ -17,6 +17,8 @@ import org.eclipse.debug.core.DebugException;
|
|||
|
||||
/**
|
||||
* Represents a module in the process being debugged.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public interface ICModule extends ICDebugElement {
|
||||
|
||||
|
@ -72,8 +74,9 @@ public interface ICModule extends ICDebugElement {
|
|||
* search mechanism will be used.
|
||||
*
|
||||
* @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.
|
||||
|
@ -96,6 +99,13 @@ public interface ICModule extends ICDebugElement {
|
|||
*/
|
||||
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.
|
||||
*
|
||||
|
@ -130,4 +140,11 @@ public interface ICModule extends ICDebugElement {
|
|||
* @return the CPU identifier
|
||||
*/
|
||||
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();
|
||||
}
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
***********************************************************************/
|
||||
package org.eclipse.cdt.debug.internal.core.model;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigInteger;
|
||||
import java.text.MessageFormat;
|
||||
import org.eclipse.cdt.core.IAddress;
|
||||
import org.eclipse.cdt.core.IAddressFactory;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
|
@ -109,7 +111,8 @@ public class CModule extends CDebugElement implements ICModule {
|
|||
/* (non-Javadoc)
|
||||
* @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;
|
||||
}
|
||||
|
||||
|
@ -142,12 +145,18 @@ public class CModule extends CDebugElement implements ICModule {
|
|||
( ( 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)
|
||||
* @see org.eclipse.cdt.debug.core.model.ICModule#loadSymbols()
|
||||
*/
|
||||
public void loadSymbols() throws DebugException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
loadSymbolsFromFile( getSymbolsFileName() );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -178,12 +187,11 @@ public class CModule extends CDebugElement implements ICModule {
|
|||
return ( fCElement instanceof IBinary ) ? ((IBinary)fCElement).getCPU() : null;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
|
||||
}
|
||||
|
||||
public boolean equals( ICDIObject cdiObject ) {
|
||||
return ( fCDIObject != null ) ? fCDIObject.equals( cdiObject ) : false;
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.model.ICModule#canModifySymbolsSource()
|
||||
*/
|
||||
public boolean canModifySymbolsSource() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -199,7 +207,26 @@ public class CModule extends CDebugElement implements ICModule {
|
|||
return super.getAdapter( adapter );
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
|
||||
}
|
||||
|
||||
public boolean equals( ICDIObject cdiObject ) {
|
||||
return ( fCDIObject != null ) ? fCDIObject.equals( cdiObject ) : false;
|
||||
}
|
||||
|
||||
protected ICElement getCElement() {
|
||||
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$
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,5 +29,8 @@ CIndexedValue.1=Index out of bounds.
|
|||
CIndexedValue.2=Specified range out of bounds.
|
||||
CModule.0=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.1=Error loading symbols.
|
||||
|
|
Loading…
Add table
Reference in a new issue