mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Generate a MIMemoryChangedEvent when doing setValue.
This commit is contained in:
parent
c8ad29addc
commit
9a92aa9b13
1 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,7 @@ import org.eclipse.cdt.debug.mi.core.MIFormat;
|
||||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIDataWriteMemory;
|
import org.eclipse.cdt.debug.mi.core.command.MIDataWriteMemory;
|
||||||
|
import org.eclipse.cdt.debug.mi.core.event.MIMemoryChangedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIDataReadMemoryInfo;
|
import org.eclipse.cdt.debug.mi.core.output.MIDataReadMemoryInfo;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIMemory;
|
import org.eclipse.cdt.debug.mi.core.output.MIMemory;
|
||||||
|
@ -134,8 +135,12 @@ public class MemoryBlock extends CObject implements ICDIMemoryBlock {
|
||||||
* @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 {
|
||||||
|
if (offset >= getLength() || offset + bytes.length > getLength()) {
|
||||||
|
throw new CDIException("Bad Offset");
|
||||||
|
}
|
||||||
MISession mi = getCTarget().getCSession().getMISession();
|
MISession mi = getCTarget().getCSession().getMISession();
|
||||||
CommandFactory factory = mi.getCommandFactory();
|
CommandFactory factory = mi.getCommandFactory();
|
||||||
|
Long[] addresses = new Long[bytes.length];
|
||||||
for (int i = 0; i < bytes.length; i++) {
|
for (int i = 0; i < bytes.length; i++) {
|
||||||
long l = new Byte(bytes[i]).longValue();
|
long l = new Byte(bytes[i]).longValue();
|
||||||
String value = "0x" + Long.toHexString(l);
|
String value = "0x" + Long.toHexString(l);
|
||||||
|
@ -150,7 +155,11 @@ public class MemoryBlock extends CObject implements ICDIMemoryBlock {
|
||||||
} catch (MIException e) {
|
} catch (MIException e) {
|
||||||
throw new CDIException(e.getMessage());
|
throw new CDIException(e.getMessage());
|
||||||
}
|
}
|
||||||
|
addresses[i] = new Long(getStartAddress() + offset + i);
|
||||||
}
|
}
|
||||||
|
// If the assign was succesfull fire a MIChangedEvent()
|
||||||
|
MIMemoryChangedEvent change = new MIMemoryChangedEvent(addresses);
|
||||||
|
mi.fireEvent(change);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue