Implementing the memory view.
Index:
ChangeLog
===================================================================
RCS
file: /home/tools/org.eclipse.cdt.debug.core/ChangeLog,v
retrieving revision
1.33
diff -u -r1.33 ChangeLog
--- ChangeLog 26 Oct 2002 23:35:29
-0000 1.33
+++ ChangeLog 28 Oct 2002 02:45:39 -0000
@@ -1,3 +1,7
@@
+2002-10-27 Mikhail Khodjaiants
+ * IFormattedMemoryBlock.java:
added the 'setItemValue' method.
+ * CFormattedMemoryBlock.java:
implementation of the 'setItemValue' method.
+
2002-10-16 Alain
Magloire
* src/.../core/cdi/model/ICDIMemoryBlock.java
(refresh):
Index:
src/org/eclipse/cdt/debug/core/IFormattedMemoryBlock.java
===================================================================
RCS
file:
/home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/IFormattedMemoryBlock.java,v
retrieving
revision 1.8
diff -u -r1.8 IFormattedMemoryBlock.java
---
src/org/eclipse/cdt/debug/core/IFormattedMemoryBlock.java 25 Oct 2002
17:05:33 -0000 1.8
+++
src/org/eclipse/cdt/debug/core/IFormattedMemoryBlock.java 28 Oct 2002
02:45:39 -0000
@@ -85,6 +85,18 @@
*/
IFormattedMemoryBlockRow[]
getRows();
+
+ /**
+ * Sets the value of data item
in this block at the specified
+ * index within this block to the
spcified value.
+ * The index is zero based.
+ *
+ *
@param index the index of item to change
+ * @param newValue the new
value
+ * @throws DebugException if this method fails. Reasons
include:
+ */
+ void setItemValue( int index, String newValue )
throws DebugException;
+
char
getPaddingCharacter();
long nextRowAddress();
Index:
src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java
===================================================================
RCS
file:
/home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java,v
retrieving
revision 1.6
diff -u -r1.6 CFormattedMemoryBlock.java
---
src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java 25
Oct 2002 15:52:16 -0000 1.6
+++
src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java 28
Oct 2002 02:45:40 -0000
@@ -6,6 +6,7 @@
package
org.eclipse.cdt.debug.internal.core.model;
import
java.util.ArrayList;
+import java.util.HashSet;
import
java.util.List;
import
org.eclipse.cdt.debug.core.CDebugCorePlugin;
@@ -83,6 +84,7
@@
private char fPaddingChar = '.';
private List
fRows = null;
private Long[] fChangedAddresses = new
Long[0];
+ private HashSet
fDirtyBytes;
/**
* Constructor for
CFormattedMemoryBlock.
@@ -96,16 +98,7
@@
int
numberOfRows,
int numberOfColumns )
{
- super(
target );
- fCDIMemoryBlock =
cdiMemoryBlock;
- fAddressExpression =
addressExpression;
- fFormat = format;
- fWordSize =
wordSize;
- fNumberOfRows =
numberOfRows;
- fNumberOfColumns =
numberOfColumns;
- fDisplayAscii =
false;
- fPaddingChar =
0;
- getCDISession().getEventManager().addEventListener( this
);
+ this( target, cdiMemoryBlock, addressExpression, format,
wordSize, numberOfRows, numberOfColumns, '\0'
);
}
/**
@@ -130,6 +123,7
@@
fNumberOfColumns =
numberOfColumns;
fDisplayAscii =
true;
fPaddingChar =
paddingChar;
+ fDirtyBytes = new
HashSet();
getCDISession().getEventManager().addEventListener(
this );
}
@@ -353,6 +347,8
@@
fCDIMemoryBlock =
null;
}
getCDISession().getEventManager().removeEventListener(
this );
+ fDirtyBytes.clear();
+ fDirtyBytes =
null;
}
/* (non-Javadoc)
@@ -439,7
+435,8 @@
private void handleChangedEvent(
ICDIMemoryChangedEvent event
)
{
- resetRows();
+ resetRows();
+ resetDirtyBytes();
setChangedAddresses(
event.getAddresses() );
fireChangeEvent( DebugEvent.CONTENT
);
}
@@ -473,5 +470,17 @@
public void
setFrozen( boolean frozen
)
{
getCDIMemoryBlock().setFrozen( frozen
);
+ }
+
+ /**
+ * @see
org.eclipse.cdt.debug.core.IFormattedMemoryBlock#setItemValue(int,
String)
+ */
+ public void setItemValue( int index, String
newValue ) throws
DebugException
+ {
+ }
+
+ private void
resetDirtyBytes()
+ {
+ fDirtyBytes.clear();
}
}