Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Added 'IExecFileInfo' interface.

Added the 'IExecFileInfo' interface to provide access to the executable file information.

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/ChangeLog,v
retrieving revision 1.43
diff -u -r1.43 ChangeLog
--- ChangeLog 1 Nov 2002 18:24:09 -0000 1.43
+++ ChangeLog 1 Nov 2002 23:15:26 -0000
@@ -1,4 +1,9 @@
 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.
  * CDebugTarget.java: removed unused constructor.

Index: IExecFileInfo.java
===================================================================
RCS file: IExecFileInfo.java
diff -N IExecFileInfo.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ IExecFileInfo.java 1 Nov 2002 23:15:50 -0000
@@ -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();
+}

Index: CDebugTarget.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java,v
retrieving revision 1.51
diff -u -r1.51 CDebugTarget.java
--- CDebugTarget.java 1 Nov 2002 18:23:49 -0000 1.51
+++ CDebugTarget.java 1 Nov 2002 23:16:17 -0000
@@ -10,6 +10,10 @@
 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.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 @@
             ISwitchToThread,
             IExpressionListener,
             ICExpressionEvaluator,
-            IDebuggerProcessSupport
+            IDebuggerProcessSupport,
+            IExecFileInfo
 {
  /**
   * The type of this target.
@@ -219,6 +225,11 @@
  private boolean fIsDebuggerProcessDefault = false;
 
  /**
+  * The executable file.
+  */
+ private IFile fExecFile;
+
+ /**
   * Constructor for CDebugTarget.
   * @param target
   */
@@ -241,9 +252,10 @@
   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();
@@ -1969,5 +1981,31 @@
  public boolean supportsDebuggerProcess()
  {
   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;
  }
 }


Back to the top