mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 11:25:35 +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;
|
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.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
|
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 class MemoryBlock extends CObject implements ICDIMemoryBlock {
|
||||||
|
|
||||||
public MemoryBlock(CTarget target) {
|
MIDataReadMemoryInfo mem;
|
||||||
|
boolean frozen;
|
||||||
|
|
||||||
|
public MemoryBlock(CTarget target, MIDataReadMemoryInfo info) {
|
||||||
super(target);
|
super(target);
|
||||||
|
mem = info;
|
||||||
|
frozen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getBytes()
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getBytes()
|
||||||
*/
|
*/
|
||||||
public byte[] getBytes() throws CDIException {
|
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()
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getLength()
|
||||||
*/
|
*/
|
||||||
public long getLength() {
|
public long getLength() {
|
||||||
return 0;
|
return mem.getTotalBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getStartAddress()
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getStartAddress()
|
||||||
*/
|
*/
|
||||||
public long getStartAddress() {
|
public long getStartAddress() {
|
||||||
return 0;
|
return mem.getAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#isFrozen()
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#isFrozen()
|
||||||
*/
|
*/
|
||||||
public boolean isFrozen() {
|
public boolean isFrozen() {
|
||||||
return false;
|
return frozen;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#setFrozen(boolean)
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#setFrozen(boolean)
|
||||||
*/
|
*/
|
||||||
public void setFrozen(boolean frozen) {
|
public void setFrozen(boolean frozen) {
|
||||||
|
this.frozen = frozen;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#setValue(long, byte[])
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#setValue(long, byte[])
|
||||||
*/
|
*/
|
||||||
public void setValue(long offset, byte[] bytes) throws CDIException {
|
public void setValue(long offset, byte[] bytes) throws CDIException {
|
||||||
}
|
throw new CDIException("Not supported");
|
||||||
|
|
||||||
/**
|
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#supportsValueModification()
|
|
||||||
*/
|
|
||||||
public boolean supportsValueModification() {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue