mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 03:15:33 +02:00
Implementing all the methods with MIDataReadMemoryInfo.
This commit is contained in:
parent
122c0c38d7
commit
ea9d2ee16e
1 changed files with 30 additions and 18 deletions
|
@ -1,67 +1,79 @@
|
|||
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIDataReadMemoryInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIMemory;
|
||||
|
||||
/**
|
||||
* @author alain
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* To enable and disable the creation of type comments go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
*/
|
||||
public class MemoryBlock extends CObject implements ICDIMemoryBlock {
|
||||
|
||||
public MemoryBlock(CTarget target) {
|
||||
MIDataReadMemoryInfo mem;
|
||||
boolean frozen;
|
||||
|
||||
public MemoryBlock(CTarget target, MIDataReadMemoryInfo info) {
|
||||
super(target);
|
||||
mem = info;
|
||||
frozen = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getBytes()
|
||||
*/
|
||||
public byte[] getBytes() throws CDIException {
|
||||
return null;
|
||||
MIMemory[] miMem = mem.getMemories();
|
||||
List aList = new ArrayList();
|
||||
for (int i = 0; i < miMem.length; i++) {
|
||||
long[] data = miMem[i].getData();
|
||||
for (int j = 0; j < data.length; j++) {
|
||||
aList.add(new Long(data[j]));
|
||||
}
|
||||
}
|
||||
byte[] bytes = new byte[aList.size()];
|
||||
for (int i = 0; i < aList.size(); i++) {
|
||||
Long l = (Long)aList.get(i);
|
||||
bytes[i] = l.byteValue();
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getLength()
|
||||
*/
|
||||
public long getLength() {
|
||||
return 0;
|
||||
return mem.getTotalBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getStartAddress()
|
||||
*/
|
||||
public long getStartAddress() {
|
||||
return 0;
|
||||
return mem.getAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#isFrozen()
|
||||
*/
|
||||
public boolean isFrozen() {
|
||||
return false;
|
||||
return frozen;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#setFrozen(boolean)
|
||||
*/
|
||||
public void setFrozen(boolean frozen) {
|
||||
this.frozen = frozen;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#setValue(long, byte[])
|
||||
*/
|
||||
public void setValue(long offset, byte[] bytes) throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#supportsValueModification()
|
||||
*/
|
||||
public boolean supportsValueModification() {
|
||||
return false;
|
||||
throw new CDIException("Not supported");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue