1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

Bug 337452: Wrong memory shown for non-stop multi-threaded programs. Cache was not being cleared properly.

This commit is contained in:
Marc Khouzam 2011-02-18 01:18:41 +00:00
parent d62d436c14
commit 8e27b8d7f6

View file

@ -429,8 +429,11 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer
}
if (e.getReason() != StateChangeReason.STEP) {
fCommandCache.reset(e.getDMContext());
IMemoryDMContext memoryDMC = DMContexts.getAncestorOfType(e.getDMContext(), IMemoryDMContext.class);
// It is the memory context we want to clear, not only the context that resumed. The resumed context
// is probably a thread but that running thread could have changed any memory within the memory
// context.
fCommandCache.reset(memoryDMC);
if (fMemoryCaches.containsKey(memoryDMC)) {
// We do not want to use the call to getMemoryCache() here.
// This is because:
@ -453,8 +456,11 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer
fCommandCache.setContextAvailable(e.getDMContext(), true);
}
fCommandCache.reset(e.getDMContext());
IMemoryDMContext memoryDMC = DMContexts.getAncestorOfType(e.getDMContext(), IMemoryDMContext.class);
// It is the memory context we want to clear, not only the context that stopped. The stopped context
// is probably a thread but that thread that ran could have changed any memory within the memory
// context.
fCommandCache.reset(memoryDMC);
if (fMemoryCaches.containsKey(memoryDMC)) {
// We do not want to use the call to getMemoryCache() here.
// This is because: