Community
Participate
Working Groups
CDT provides a feature to allow to do reverse debugging (step backwards). When reverse debugging is possible, CDT makes visible 4 new buttons on the debug toolbar: "reverse step into", "reverse step over", "reverse resume", and "uncall" (reverse step return). This small howto shows screenshots of the buttons and how to enable them: http://wiki.eclipse.org/CDT/User/FAQ#How_do_I_do_Reverse_Debugging.3F The problem is that when the 'toggle reverse debugging' is pressed, the buttons don't appear immediately with 4.2. In 3.8 we achieved the immediate visibility using: IEvaluationService exprService = (IEvaluationService) PlatformUI.getWorkbench().getService(IEvaluationService.class); exprService.requestEvaluation("org.eclipse.cdt.debug.ui.isReverseDebuggingEnabled"); This is called in CDT's org.eclipse.cdt.debug.internal.ui.commands.ReverseToggleCommandHandler In turn, in 3.8, the IEvaluationService calls org.eclipse.cdt.dsf.gdb.internal.ui.actions.ReverseDebuggingPropertyTester right away. In 4.2, when I press the 'toggle reverse debugging' button, IEvaluationService.requestEvaluation() is being called, but it never gets to the CDT property tester anymore. If I can help get more info, please let me know.
I'm using the latest I-build: I20120321
Pawel wrote example code for the the platform's PDS example debugger that reproduce this problem. Please see Bug 376442 comment 14. Using that modified PDA example: 1- launch a PDA debugger with the counter.pda sample 2- press on the "Restart enable" button on the debug view toolbar (gray-ish button) 3- nothing happens with 4.2 4- click anywhere else and a new Restart button appears in the debug view toolbar (button with a plus sign) In this case, the IEvaluationService.requestEvaluation() is being called by RestartEnableCommandHandler.postExecute which is in the plugin org.eclipse.debug.examples.ui
(In reply to comment #2) > Pawel wrote example code for the the platform's PDS example debugger Sorry, "PDA" example
I'll need to ask Paul about this as I am not familiar with the code. It seems that in 4.x the ReferenceExpression is not added to the EvaluationService for <visibleWhen> <reference definitionId="org.eclipse.debug.examples.ui.testIsRestartEnabled"> </reference> </visibleWhen> In 3.x reference is added in the following call stack: EvaluationAuthority.addEvaluationListener(IEvaluationReference) line: 68 EvaluationService.addEvaluationListener(Expression, IPropertyChangeListener, String) line: 47 WorkbenchMenuService.registerVisibleWhen(IContributionItem, Expression, Set, String) line: 884 ContributionRoot.addContributionItem(IContributionItem, Expression) line: 60 MenuAdditionCacheEntry.createContributionItems(IServiceLocator, IContributionRoot) line: 188 WorkbenchMenuService$5.run() line: 584 SafeRunner.run(ISafeRunnable) line: 42 WorkbenchMenuService.processAdditions(IServiceLocator, Set, ContributionManager, AbstractContributionFactory, Set) line: 656 WorkbenchMenuService.addContributionsToManager(IServiceLocator, Set, ContributionManager, String, boolean, List) line: 744 WorkbenchMenuService.populateContributionManager(IServiceLocator, Set, ContributionManager, String, boolean) line: 730 SlaveMenuService.populateContributionManager(IServiceLocator, Set, ContributionManager, String, boolean) line: 203 SlaveMenuService.populateContributionManager(ContributionManager, String) line: 76 ViewReference.createPartHelper() line: 406 ViewReference.createPart() line: 240 ViewReference(WorkbenchPartReference).getPart(boolean) line: 595 ViewPane(PartPane).setVisible(boolean) line: 315
For menus and toolbars this doesn't go through the IEvaluationService anymore I guess. It looks like the toolbar contribution RAT would be set up in org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer.processAddition(MToolBar, ToolBarManager, MToolBarContribution) PW
org.eclipse.ui.internal.services.EvaluationService.requestEvaluation(String) already walks through code that uses the IEvaluationService and will re-evaluate the mentioned property. The problem in question is that visibleWhen for the toolbars is now managed by a RAT in ToolBarManagerRenderer.processAddition(*). The RAT has code that calls down to org.eclipse.e4.ui.internal.workbench.ContributionsAnalyzer.isVisible(MCoreExpression, ExpressionContext) which takes the core expression ReferenceExpression and evaluates it against the IEclipseContext contained within the ExpressionContext. We can get the names of any property testers used by the ReferenceExpression using code like: ExpressionInfo info = refExpr.computeExpressionInfo(); String[] names = info.getAccessedPropertyNames(); One way to hook them up would be to have the RAT get(*) the property names so they're recorded, and have the requestEvaluation(*) method set them in the application IEclipseContext so that the rats are kicked off. PW
Thanks Paul! http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=b02661368d6e68ac34cede3e613263240f733138
Verified with I20120429-1800 Thanks guys!
(In reply to comment #8) > Verified with I20120429-1800 > > Thanks guys! Thank you!