Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Implementing core classes for disassembly mode

Implementing the core classes for disassembly mode.
 
Index: src/org/eclipse/cdt/debug/internal/core/DisassemblyStorage.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DisassemblyStorage.java,v
retrieving revision 1.1
diff -u -r1.1 DisassemblyStorage.java
--- src/org/eclipse/cdt/debug/internal/core/DisassemblyStorage.java 8 Oct 2002 22:03:21 -0000 1.1
+++ src/org/eclipse/cdt/debug/internal/core/DisassemblyStorage.java 9 Oct 2002 23:03:31 -0000
@@ -14,6 +14,7 @@
 import org.eclipse.core.resources.IStorage;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.debug.core.DebugException;
 import org.eclipse.debug.core.model.IDebugTarget;
 
 /**
@@ -36,6 +37,8 @@
  {
   setDebugTarget( target );
   setInstructions( instructions );
+  initializeAddresses();
+  createContent();
  }
 
  /* (non-Javadoc)
@@ -85,7 +88,18 @@
   */
  public String getName()
  {
-  return null;
+  try
+  {
+   if ( getDebugTarget() != null )
+   {
+    return  getDebugTarget().getName();
+   }
+  }
+  catch( DebugException e )
+  {
+   // ignore
+  }
+  return "disassembly";
  }
 
  /* (non-Javadoc)
@@ -118,5 +132,19 @@
  protected void setInstructions( ICDIInstruction[] intructions )
  {
   fInstructions = intructions;
+ }
+
+ private void createContent()
+ {
+  StringBuffer lines = new StringBuffer();
+  for ( int i = 0; i < fInstructions.length; ++i )
+  {
+   lines.append( fInstructions[i].toString() );
+  }
+  fInputStream = new ByteArrayInputStream( lines.toString().getBytes() );
+ }
+
+ private void initializeAddresses()
+ {
  }
 }

Back to the top