1
0
Fork 0
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:
Mikhail Khodjaiants 2002-11-01 23:17:17 +00:00
parent bfcdb80713
commit 0397c4165b
3 changed files with 62 additions and 3 deletions

View file

@ -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 2002-10-31 Mikhail Khodjaiants
Replaced the 'IProject' argument by 'IFile' in the debug target factory methods - second phase. Replaced the 'IProject' argument by 'IFile' in the debug target factory methods - second phase.
* CDebugModel.java: removed unused debug target factory methods. * CDebugModel.java: removed unused debug target factory methods.

View file

@ -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();
}

View file

@ -10,6 +10,10 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; 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.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.CDebugModel; import org.eclipse.cdt.debug.core.CDebugModel;
import org.eclipse.cdt.debug.core.ICBreakpoint; 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.ICMemoryManager;
import org.eclipse.cdt.debug.core.ICWatchpoint; import org.eclipse.cdt.debug.core.ICWatchpoint;
import org.eclipse.cdt.debug.core.IDebuggerProcessSupport; 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.IFormattedMemoryBlock;
import org.eclipse.cdt.debug.core.IFormattedMemoryRetrieval; import org.eclipse.cdt.debug.core.IFormattedMemoryRetrieval;
import org.eclipse.cdt.debug.core.IRestart; import org.eclipse.cdt.debug.core.IRestart;
@ -104,7 +109,8 @@ public class CDebugTarget extends CDebugElement
ISwitchToThread, ISwitchToThread,
IExpressionListener, IExpressionListener,
ICExpressionEvaluator, ICExpressionEvaluator,
IDebuggerProcessSupport IDebuggerProcessSupport,
IExecFileInfo
{ {
/** /**
* The type of this target. * The type of this target.
@ -218,6 +224,11 @@ public class CDebugTarget extends CDebugElement
*/ */
private boolean fIsDebuggerProcessDefault = false; private boolean fIsDebuggerProcessDefault = false;
/**
* The executable file.
*/
private IFile fExecFile;
/** /**
* Constructor for CDebugTarget. * Constructor for CDebugTarget.
* @param target * @param target
@ -241,9 +252,10 @@ public class CDebugTarget extends CDebugElement
setCDITarget( cdiTarget ); setCDITarget( cdiTarget );
setBreakpoints( new HashMap( 5 ) ); setBreakpoints( new HashMap( 5 ) );
setTemporaryBreakpoints( new ArrayList() ); 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() ); setConfiguration( cdiTarget.getSession().getConfiguration() );
fSupportsTerminate = allowsTerminate & getConfiguration().supportsTerminate(); fSupportsTerminate = allowsTerminate & getConfiguration().supportsTerminate();
@ -1970,4 +1982,30 @@ public class CDebugTarget extends CDebugElement
{ {
return ( fDebuggerProcess != null ); 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;
}
} }