mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Added 'IExecFileInfo' interface.
This commit is contained in:
parent
bfcdb80713
commit
0397c4165b
3 changed files with 62 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
2002-10-31 Mikhail Khodjaiants
|
||||
Added the 'IExecFileInfo' interface to provide access to the executable file information.
|
||||
* IExecFileInfo.java: definition
|
||||
* CDebugTarget.java: implementation
|
||||
|
||||
2002-10-31 Mikhail Khodjaiants
|
||||
Replaced the 'IProject' argument by 'IFile' in the debug target factory methods - second phase.
|
||||
* CDebugModel.java: removed unused debug target factory methods.
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
package org.eclipse.cdt.debug.core;
|
||||
|
||||
/**
|
||||
* Provides access to executable file information.
|
||||
*
|
||||
* @since: Nov 1, 2002
|
||||
*/
|
||||
public interface IExecFileInfo
|
||||
{
|
||||
public boolean isLittleEndian();
|
||||
}
|
|
@ -10,6 +10,10 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.IBinary;
|
||||
import org.eclipse.cdt.core.model.ICFile;
|
||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||
import org.eclipse.cdt.debug.core.CDebugModel;
|
||||
import org.eclipse.cdt.debug.core.ICBreakpoint;
|
||||
|
@ -19,6 +23,7 @@ import org.eclipse.cdt.debug.core.ICLineBreakpoint;
|
|||
import org.eclipse.cdt.debug.core.ICMemoryManager;
|
||||
import org.eclipse.cdt.debug.core.ICWatchpoint;
|
||||
import org.eclipse.cdt.debug.core.IDebuggerProcessSupport;
|
||||
import org.eclipse.cdt.debug.core.IExecFileInfo;
|
||||
import org.eclipse.cdt.debug.core.IFormattedMemoryBlock;
|
||||
import org.eclipse.cdt.debug.core.IFormattedMemoryRetrieval;
|
||||
import org.eclipse.cdt.debug.core.IRestart;
|
||||
|
@ -104,7 +109,8 @@ public class CDebugTarget extends CDebugElement
|
|||
ISwitchToThread,
|
||||
IExpressionListener,
|
||||
ICExpressionEvaluator,
|
||||
IDebuggerProcessSupport
|
||||
IDebuggerProcessSupport,
|
||||
IExecFileInfo
|
||||
{
|
||||
/**
|
||||
* The type of this target.
|
||||
|
@ -218,6 +224,11 @@ public class CDebugTarget extends CDebugElement
|
|||
*/
|
||||
private boolean fIsDebuggerProcessDefault = false;
|
||||
|
||||
/**
|
||||
* The executable file.
|
||||
*/
|
||||
private IFile fExecFile;
|
||||
|
||||
/**
|
||||
* Constructor for CDebugTarget.
|
||||
* @param target
|
||||
|
@ -241,9 +252,10 @@ public class CDebugTarget extends CDebugElement
|
|||
setCDITarget( cdiTarget );
|
||||
setBreakpoints( new HashMap( 5 ) );
|
||||
setTemporaryBreakpoints( new ArrayList() );
|
||||
if ( file != null )
|
||||
setExecFile( file );
|
||||
if ( getExecFile() != null )
|
||||
{
|
||||
getLaunch().setSourceLocator( createSourceLocator( file.getProject() ) );
|
||||
getLaunch().setSourceLocator( createSourceLocator( getExecFile().getProject() ) );
|
||||
}
|
||||
setConfiguration( cdiTarget.getSession().getConfiguration() );
|
||||
fSupportsTerminate = allowsTerminate & getConfiguration().supportsTerminate();
|
||||
|
@ -1970,4 +1982,30 @@ public class CDebugTarget extends CDebugElement
|
|||
{
|
||||
return ( fDebuggerProcess != null );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.IExecFileInfo#isLittleEndian()
|
||||
*/
|
||||
public boolean isLittleEndian()
|
||||
{
|
||||
if ( getExecFile() != null && CoreModel.isBinary( getExecFile() ) )
|
||||
{
|
||||
ICFile cFile = CCorePlugin.getDefault().getCoreModel().create( getExecFile() );
|
||||
if ( cFile instanceof IBinary )
|
||||
{
|
||||
((IBinary)cFile).isLittleEndian();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected IFile getExecFile()
|
||||
{
|
||||
return fExecFile;
|
||||
}
|
||||
|
||||
private void setExecFile( IFile file )
|
||||
{
|
||||
fExecFile = file;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue