Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeep Amin2020-08-06 17:10:06 +0000
committerDeep Amin2020-08-10 17:38:56 +0000
commit874e85b2b45b238404d6b8e11b80fda8a3425677 (patch)
tree977d67943d579addb3c066375189bbe3a998844c /plugins
parent375b307466a51ee87ea47540f74890535c46a3ce (diff)
downloadorg.eclipse.tcf-874e85b2b45b238404d6b8e11b80fda8a3425677.tar.gz
org.eclipse.tcf-874e85b2b45b238404d6b8e11b80fda8a3425677.tar.xz
org.eclipse.tcf-874e85b2b45b238404d6b8e11b80fda8a3425677.zip
Bug 565720 - Automatic disassembly view refresh with memory map events
Change-Id: Ibd121e6a22a2156e7112b1687d01a9ecf70a2f14 Signed-off-by: Deep Amin <deep.amin@intel.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java24
1 files changed, 24 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 cbccd0343..8bf53b83b 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,6 +63,8 @@ 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.MemoryError;
+import org.eclipse.tcf.services.IMemoryMap;
+import org.eclipse.tcf.services.IMemoryMap.MemoryMapListener;
import org.eclipse.tcf.services.IMemory;
import org.eclipse.tcf.services.IRunControl;
import org.eclipse.tcf.services.IRunControl.RunControlContext;
@@ -194,6 +196,23 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
}
}
+ private class TCFMemoryMapListener implements MemoryMapListener {
+
+ @Override
+ public void changed(String context_id) {
+ 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;
@@ -272,6 +291,7 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
}
private final IRunControl.RunControlListener fRunControlListener = new TCFRunControlListener();
+ private final IMemoryMap.MemoryMapListener fMemoryMapListener = new TCFMemoryMapListener();
private final IChannelListener fChannelListener = new TCFChannelListener();
private final ILaunchesListener fLaunchesListener = new TCFLaunchListener();
@@ -367,6 +387,8 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
IChannel channel = context.getChannel();
IRunControl rctl = channel.getRemoteService(IRunControl.class);
if (rctl != null) rctl.addListener(fRunControlListener);
+ IMemoryMap mmap = channel.getRemoteService(IMemoryMap.class);
+ if (mmap != null) mmap.addListener(fMemoryMapListener);
channel.addChannelListener(fChannelListener);
}
});
@@ -381,6 +403,8 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
IChannel channel = context.getChannel();
IRunControl rctl = channel.getRemoteService(IRunControl.class);
if (rctl != null) rctl.removeListener(fRunControlListener);
+ IMemoryMap mmap = channel.getRemoteService(IMemoryMap.class);
+ if (mmap != null) mmap.removeListener(fMemoryMapListener);
channel.removeChannelListener(fChannelListener);
}
});

Back to the top