1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

New methods to expose internal variable fields.

This commit is contained in:
Alain Magloire 2002-10-19 19:19:53 +00:00
parent 6211cfdea3
commit 0ce8dee341

View file

@ -13,14 +13,61 @@ import org.eclipse.cdt.debug.mi.core.output.MIMemory;
public class MemoryBlock extends CObject implements ICDIMemoryBlock { public class MemoryBlock extends CObject implements ICDIMemoryBlock {
MIDataReadMemoryInfo mem; MIDataReadMemoryInfo mem;
String expression;
boolean frozen; boolean frozen;
public MemoryBlock(CTarget target, MIDataReadMemoryInfo info) { public MemoryBlock(CTarget target, String exp, MIDataReadMemoryInfo info) {
super(target); super(target);
expression = exp;
mem = info; mem = info;
frozen = true; frozen = true;
} }
/**
* @return the expression use to create the block.
*/
public String getExpression() {
return expression;
}
/**
* Reset the internal MIDataReadMemoryInfo.
*/
public void setMIDataReadMemoryInfo(MIDataReadMemoryInfo m) {
mem = m;
}
/**
* @return the internal MIDataReadMemoryInfo.
*/
public MIDataReadMemoryInfo getMIDataReadMemoryInfo() {
return mem;
}
/**
* @return true if any address in the array is within the block.
*/
public boolean contains(Long[] adds) {
for (int i = 0; i < adds.length; i++) {
if (contains(adds[i])) {
return true;
}
}
return false;
}
/**
* @return true if the address is within the block.
*/
public boolean contains(Long addr) {
long start = getStartAddress();
long length = getLength();
if (start <= addr.longValue() && addr.longValue() <= start + length) {
return true;
}
return false;
}
/** /**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getBytes() * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getBytes()
*/ */