1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

[262680] [memory] OutOfMemory exception in traditional rendering

This commit is contained in:
Ted Williams 2009-03-14 06:00:46 +00:00
parent 25b0ee6d2e
commit 76dff04194

View file

@ -859,12 +859,12 @@ public class Rendering extends Composite implements IDebugEventSetListener
{
try
{
final IMemoryBlockExtension memoryBlock = getMemoryBlock();
IMemoryBlockExtension memoryBlock = getMemoryBlock();
final BigInteger lengthInBytes = endAddress.subtract(startAddress);
final BigInteger addressableSize = BigInteger.valueOf(getAddressableSize());
BigInteger lengthInBytes = endAddress.subtract(startAddress);
BigInteger addressableSize = BigInteger.valueOf(getAddressableSize());
final long units = lengthInBytes.divide(addressableSize).add(
long units = lengthInBytes.divide(addressableSize).add(
lengthInBytes.mod(addressableSize).compareTo(BigInteger.ZERO) > 0
? BigInteger.ONE : BigInteger.ZERO).longValue();
@ -873,8 +873,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
// change history. Ideally, we should strictly use the back end change notification
// and history, but it is only guaranteed to work for bytes within the address range
// of the MemoryBlock.
final MemoryByte readBytes[] = memoryBlock
.getBytesFromAddress(startAddress, units);
MemoryByte readBytes[] = memoryBlock.getBytesFromAddress(startAddress, units);
TraditionalMemoryByte cachedBytes[] = new TraditionalMemoryByte[readBytes.length];
for(int i = 0; i < readBytes.length; i++)
@ -907,6 +906,12 @@ public class Rendering extends Composite implements IDebugEventSetListener
}
final TraditionalMemoryByte[] cachedBytesFinal = cachedBytes;
fCache = new MemoryUnit();
fCache.start = startAddress;
fCache.end = endAddress;
fCache.bytes = cachedBytesFinal;
Display.getDefault().asyncExec(new Runnable()
{
public void run()
@ -944,11 +949,6 @@ public class Rendering extends Composite implements IDebugEventSetListener
}
}
fCache = new MemoryUnit();
fCache.start = startAddress;
fCache.end = endAddress;
fCache.bytes = cachedBytesFinal;
// If the history does not exist, populate the history with the just populated cache. This solves the
// use case of 1) connect to target; 2) edit memory before the first suspend debug event; 3) paint
// differences in changed color.