Skip to main content
summaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorAnton Leherbauer2010-12-22 06:22:16 -0500
committerAnton Leherbauer2010-12-22 06:22:16 -0500
commitd395d762b8d40fb9a3e5f6ad7fe16c4c8e27cd7f (patch)
tree0e2569792073aee3fcdf907df38296a6ffa7c129 /debug
parent7d24065c7d2f236f88fe4c27f1f435134696ba9a (diff)
downloadorg.eclipse.cdt-d395d762b8d40fb9a3e5f6ad7fe16c4c8e27cd7f.tar.gz
org.eclipse.cdt-d395d762b8d40fb9a3e5f6ad7fe16c4c8e27cd7f.tar.xz
org.eclipse.cdt-d395d762b8d40fb9a3e5f6ad7fe16c4c8e27cd7f.zip
Bug 290572 - [reverse] Reverse buttons don't appear as soon as we turn on Reverse Debugging
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/plugin.xml20
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ReverseToggleCommandHandler.java50
2 files changed, 44 insertions, 26 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml
index 632b796deb..1c255cecb8 100644
--- a/debug/org.eclipse.cdt.debug.ui/plugin.xml
+++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml
@@ -1918,20 +1918,16 @@
<reference
definitionId="org.eclipse.cdt.debug.ui.testIsReverseDebuggingActionSetActive">
</reference>
- <or>
<with
- variable="activePart">
- <test
- property="org.eclipse.cdt.debug.ui.isReverseDebuggingEnabled">
- </test>
+ variable="debugContext">
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <test
+ property="org.eclipse.cdt.debug.ui.isReverseDebuggingEnabled">
+ </test>
+ </iterate>
</with>
- <with
- variable="selection">
- <test
- property="org.eclipse.cdt.debug.ui.isReverseDebuggingEnabled">
- </test>
- </with>
- </or>
</and>
</definition>
<definition id="org.eclipse.cdt.debug.ui.testIsTracepointActionSetActive">
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ReverseToggleCommandHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ReverseToggleCommandHandler.java
index e177bc2c38..4b17b80ad6 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ReverseToggleCommandHandler.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ReverseToggleCommandHandler.java
@@ -15,7 +15,11 @@ import java.util.Map;
import org.eclipse.cdt.debug.core.model.IReverseToggleHandler;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.IRequest;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.actions.DebugCommandHandler;
import org.eclipse.debug.ui.contexts.DebugContextEvent;
@@ -28,6 +32,8 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.menus.UIElement;
+import org.eclipse.ui.progress.WorkbenchJob;
+import org.eclipse.ui.services.IEvaluationService;
/**
* Command handler to toggle reverse debugging mode
@@ -35,10 +41,10 @@ import org.eclipse.ui.menus.UIElement;
* @since 7.0
*/
public class ReverseToggleCommandHandler extends DebugCommandHandler implements IDebugContextListener, IElementUpdater {
- @Override
- protected Class<?> getCommandType() {
- return IReverseToggleHandler.class;
- }
+ @Override
+ protected Class<?> getCommandType() {
+ return IReverseToggleHandler.class;
+ }
//
// The below logic allows us to keep the checked state of the toggle button
@@ -71,14 +77,14 @@ public class ReverseToggleCommandHandler extends DebugCommandHandler implements
}
@Override
- public void dispose() {
- // Must use the stored context service. If we try to fetch the service
- // again with the workbenchWindow, it may fail if the window is
- // already closed.
- if (fContextService != null) {
- fContextService.removePostDebugContextListener(this);
- }
- fTargetAdapter = null;
+ public void dispose() {
+ // Must use the stored context service. If we try to fetch the service
+ // again with the workbenchWindow, it may fail if the window is
+ // already closed.
+ if (fContextService != null) {
+ fContextService.removePostDebugContextListener(this);
+ }
+ fTargetAdapter = null;
super.dispose();
}
@@ -115,8 +121,24 @@ public class ReverseToggleCommandHandler extends DebugCommandHandler implements
return adapter;
}
- public void updateElement(UIElement element,
- @SuppressWarnings("unchecked") Map parameters) {
+ @Override
+ protected void postExecute(IRequest request, Object[] targets) {
+ super.postExecute(request, targets);
+ // request re-evaluation of property "org.eclipse.cdt.debug.ui.isReverseDebuggingEnabled"
+ new WorkbenchJob("") { //$NON-NLS-1$
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ IEvaluationService exprService = (IEvaluationService) PlatformUI.getWorkbench().getService(IEvaluationService.class);
+ if (exprService != null) {
+ exprService.requestEvaluation("org.eclipse.cdt.debug.ui.isReverseDebuggingEnabled"); //$NON-NLS-1$
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+
+ public void updateElement(UIElement element,
+ @SuppressWarnings("rawtypes") Map parameters) {
// Make sure the toggle state reflects the actual state
// We must check this, in case we have multiple launches
// or if we re-launch (restart)

Back to the top