Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeep Amin2021-09-23 12:26:15 +0000
committerDeep Amin2021-09-30 11:50:32 +0000
commit3eee8e67433b9a9657a0efc00a13b9744dcf3f6a (patch)
tree2d39db9c34c12f7c1044f9dec66865538899326e
parent43ac28c76fc7a846abc5b39eb8ef0987b9b85948 (diff)
downloadorg.eclipse.tcf-3eee8e67433b9a9657a0efc00a13b9744dcf3f6a.tar.gz
org.eclipse.tcf-3eee8e67433b9a9657a0efc00a13b9744dcf3f6a.tar.xz
org.eclipse.tcf-3eee8e67433b9a9657a0efc00a13b9744dcf3f6a.zip
Bug 575916: Disassembly update with Memory changed events
Change-Id: I38a596a32fd990c9d88234dcaea5a158fe6a685c Signed-off-by: Deep Amin <deep.amin@intel.com>
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
index 726ba26c8..7f0f91074 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
@@ -63,7 +63,9 @@ import org.eclipse.tcf.services.IExpressions.Value;
import org.eclipse.tcf.services.ILineNumbers;
import org.eclipse.tcf.services.ILineNumbers.CodeArea;
import org.eclipse.tcf.services.ILineNumbers.DoneMapToSource;
+import org.eclipse.tcf.services.IMemory.MemoryContext;
import org.eclipse.tcf.services.IMemory.MemoryError;
+import org.eclipse.tcf.services.IMemory.MemoryListener;
import org.eclipse.tcf.services.IMemoryMap;
import org.eclipse.tcf.services.IMemoryMap.MemoryMapListener;
import org.eclipse.tcf.services.IMemory;
@@ -214,6 +216,35 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
}
}
+ private class TCFMemoryListener implements MemoryListener {
+
+ @Override
+ public void contextAdded(MemoryContext[] contexts) {
+ }
+
+ @Override
+ public void contextChanged(MemoryContext[] contexts) {
+ }
+
+ @Override
+ public void contextRemoved(String[] context_ids) {
+ }
+
+ @Override
+ public void memoryChanged(String context_id, Number[] addr, long[] size) {
+ if (fMemoryContext == null)
+ return;
+ if (!fMemoryContext.getID().equals(context_id))
+ return;
+ if (fCallback == null)
+ return;
+ try {
+ fCallback.getClass().getMethod("refresh").invoke(fCallback);
+ } catch (Exception e) {
+ }
+ }
+ }
+
private volatile boolean fSuspended;
private volatile TCFNodeExecContext fExecContext;
private volatile TCFNodeExecContext fMemoryContext;
@@ -294,6 +325,7 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
private final IRunControl.RunControlListener fRunControlListener = new TCFRunControlListener();
private final IMemoryMap.MemoryMapListener fMemoryMapListener = new TCFMemoryMapListener();
+ private final IMemory.MemoryListener fMemoryListener = new TCFMemoryListener();
private final IChannelListener fChannelListener = new TCFChannelListener();
private final ILaunchesListener fLaunchesListener = new TCFLaunchListener();
@@ -387,6 +419,8 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
if (rctl != null) rctl.addListener(fRunControlListener);
IMemoryMap mmap = channel.getRemoteService(IMemoryMap.class);
if (mmap != null) mmap.addListener(fMemoryMapListener);
+ IMemory memory = channel.getRemoteService(IMemory.class);
+ if (memory != null) memory.addListener(fMemoryListener);
channel.addChannelListener(fChannelListener);
}
});
@@ -403,6 +437,8 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
if (rctl != null) rctl.removeListener(fRunControlListener);
IMemoryMap mmap = channel.getRemoteService(IMemoryMap.class);
if (mmap != null) mmap.removeListener(fMemoryMapListener);
+ IMemory memory = channel.getRemoteService(IMemory.class);
+ if (memory != null) memory.removeListener(fMemoryListener);
channel.removeChannelListener(fChannelListener);
}
});

Back to the top