1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Enhanced Expressions: menu for add locals and registers in dsf

Added a popup menu in expressions menu to add locals group
and registers group - for discoverability of this feature.

The menus are added to generic dsf but the command handlers 
added to the gdb plugin, just in case somebody wants to implement
this for another dsf based debugger

Change-Id: Iab64e2a9f3a0c81f8bac939a2a5e94c67ef1daba
This commit is contained in:
Alena Laskavaia 2015-01-19 20:47:40 -05:00 committed by Elena Laskavaia
parent 56aa41f360
commit 7124bcc621
5 changed files with 122 additions and 0 deletions

View file

@ -355,6 +355,26 @@
</count>
</with>
</activeWhen>
</handler>
<handler
class="org.eclipse.cdt.dsf.gdb.internal.ui.commands.AddLocalsExpressionCommandHandler"
commandId="org.eclipse.cdt.dsf.ui.addLocalsExpression">
<activeWhen>
<with variable="org.eclipse.core.runtime.Platform">
<test property="org.eclipse.core.runtime.bundleState"
args="org.eclipse.cdt.dsf.gdb.ui" value="ACTIVE"/>
</with>
</activeWhen>
</handler>
<handler
class="org.eclipse.cdt.dsf.gdb.internal.ui.commands.AddRegistersExpressionCommandHandler"
commandId="org.eclipse.cdt.dsf.ui.addRegistersExpression">
<activeWhen>
<with variable="org.eclipse.core.runtime.Platform">
<test property="org.eclipse.core.runtime.bundleState"
args="org.eclipse.cdt.dsf.gdb.ui" value="ACTIVE"/>
</with>
</activeWhen>
</handler>
</extension>
<extension

View file

@ -0,0 +1,35 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software System and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Elena Laskavaia (QNX Software System) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.internal.ui.commands;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IExpressionManager;
/**
* Handling of adding group of locals into expression view
*
* @since 2.4
*/
public class AddLocalsExpressionCommandHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager();
expressionManager.addExpression(expressionManager.newWatchExpression(getExpression()));
return null;
}
protected String getExpression() {
return "=*"; //$NON-NLS-1$
}
}

View file

@ -0,0 +1,23 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software System and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Elena Laskavaia (QNX Software System) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.internal.ui.commands;
/**
* Handling of adding group of registers into expression view
*
* @since 2.4
*/
public class AddRegistersExpressionCommandHandler extends AddLocalsExpressionCommandHandler {
@Override
protected String getExpression() {
return "=$*"; //$NON-NLS-1$
}
}

View file

@ -55,6 +55,12 @@ popup.resumeAtLine.label=Resume At Li&ne
popup.moveToLine.label=&Move To Line
popup.runToLine.label=Run To &Line
menu.addGroup.label=Add Expression Group
command.addLocals.label=Local Variables
command.addRegisters.label=Registers
command.addLocals.name=Add Expression Group > Local Variables
command.addRegisters.name=Add Expression Group > Registers
command.refreshAll.name=Refresh Debug Views
command.refreshAll.description=Refresh all data in debug views

View file

@ -255,6 +255,31 @@
<separator name="formatting" visible="true"/>
<separator name="updatePolicy" visible="true"/>
</menuContribution>
<menuContribution
locationURI="popup:org.eclipse.debug.ui.ExpressionView?after=expressionGroup">
<menu
id="org.eclipse.cdt.dsf.debug.ui.ExpressionsView_addgroup"
label="%menu.addGroup.label">
<visibleWhen checkEnabled="true">
</visibleWhen>
</menu>
</menuContribution>
<menuContribution
locationURI="popup:org.eclipse.cdt.dsf.debug.ui.ExpressionsView_addgroup">
<command
id="org.eclipse.cdt.dsf.ui.menu.addRegistersExpression"
commandId="org.eclipse.cdt.dsf.ui.addRegistersExpression"
label="%command.addRegisters.label">
<visibleWhen checkEnabled="true"/>
</command>
<command
id="org.eclipse.cdt.dsf.ui.menu.addLocalsExpression"
commandId="org.eclipse.cdt.dsf.ui.addLocalsExpression"
label="%command.addLocals.label">
<visibleWhen checkEnabled="true"/>
</command>
</menuContribution>
<menuContribution
locationURI="menu:org.eclipse.debug.ui.ExpressionView?after=updatePolicy">
<menu
@ -327,6 +352,7 @@
<reference definitionId="org.eclipse.cdt.dsf.debug.ui.testAreUpdatePoliciesSupported"/>
</activeWhen>
</handler>
<handler
class="org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.actions.DsfViewMemoryHandler"
commandId="org.eclipse.cdt.debug.ui.commands.viewMemory">
@ -578,6 +604,18 @@
id="org.eclipse.cdt.dsf.debug.ui.disassembly.commands.rulerToggleBreakpoint"
name="%command.rulerToggleBreakpoint.name">
</command>
<command
id="org.eclipse.cdt.dsf.ui.addLocalsExpression"
name="%command.addLocals.name"
categoryId="org.eclipse.debug.ui.category.run"
>
</command>
<command
id="org.eclipse.cdt.dsf.ui.addRegistersExpression"
name="%command.addRegisters.name"
categoryId="org.eclipse.debug.ui.category.run"
>
</command>
</extension>
<extension point="org.eclipse.ui.bindings">