mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for bug 214550.
All variable objects are marked out-of-date on a MemoryChangedEvent
This commit is contained in:
parent
8c6342dc6d
commit
398f01e873
2 changed files with 21 additions and 6 deletions
|
@ -892,7 +892,7 @@ public class ExpressionService extends AbstractDsfService implements IExpression
|
|||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IMemoryChangedEvent e) {
|
||||
fExpressionCache.reset();
|
||||
// We must also deal with our MIVariableManager since it
|
||||
// caches variable values, which may now have changed
|
||||
// MIVariableManager separately traps this event
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.eclipse.dd.dsf.debug.service.IStack;
|
|||
import org.eclipse.dd.dsf.debug.service.IExpressions.IExpressionDMContext;
|
||||
import org.eclipse.dd.dsf.debug.service.IFormattedValues.FormattedValueDMContext;
|
||||
import org.eclipse.dd.dsf.debug.service.IFormattedValues.FormattedValueDMData;
|
||||
import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryChangedEvent;
|
||||
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommand;
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
|
||||
|
@ -1629,20 +1630,34 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
return MIPlugin.getBundleContext();
|
||||
}
|
||||
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IRunControl.IResumedDMEvent e) {
|
||||
// Program has resumed, all variable objects need to be updated.
|
||||
// Since only roots can actually be updated in GDB, we only need
|
||||
// to deal with those. Also, to optimize this operation, we have
|
||||
// a list of all roots that have been updated, so we only have to
|
||||
// set those to needing to be updated.
|
||||
private void markAllOutOfDate() {
|
||||
MIRootVariableObject root;
|
||||
while ((root = updatedRootList.poll()) != null) {
|
||||
root.markAsOutOfDate();
|
||||
}
|
||||
}
|
||||
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IRunControl.IResumedDMEvent e) {
|
||||
// Program has resumed, all variable objects need to be updated.
|
||||
// Since only roots can actually be updated in GDB, we only need
|
||||
// to deal with those. Also, to optimize this operation, we have
|
||||
// a list of all roots that have been updated, so we only have to
|
||||
// set those to needing to be updated.
|
||||
markAllOutOfDate();
|
||||
}
|
||||
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IRunControl.ISuspendedDMEvent e) {
|
||||
}
|
||||
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IMemoryChangedEvent e) {
|
||||
// Some memory has changed. We currently do not know the address
|
||||
// of each of our variable objects, so there is no way to know
|
||||
// which one is affected. Mark them all as out of date.
|
||||
// The views will fully refresh on a MemoryChangedEvent
|
||||
markAllOutOfDate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue