Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2015-01-20 01:47:40 +0000
committerGerrit Code Review @ Eclipse.org2015-01-26 15:43:22 +0000
commitb44dbb9ea584c8be6894ee3d2e63a31bd5c5678b (patch)
tree4de25b9807d72aece96ca9f25e9bb11886d0c1f9
parent6b1edc49ffa10538399c3cece0eb04c2ba8150f1 (diff)
downloadorg.eclipse.cdt-b44dbb9ea584c8be6894ee3d2e63a31bd5c5678b.tar.gz
org.eclipse.cdt-b44dbb9ea584c8be6894ee3d2e63a31bd5c5678b.tar.xz
org.eclipse.cdt-b44dbb9ea584c8be6894ee3d2e63a31bd5c5678b.zip
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
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml20
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/AddLocalsExpressionCommandHandler.java35
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/AddRegistersExpressionCommandHandler.java23
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/plugin.properties6
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/plugin.xml38
5 files changed, 122 insertions, 0 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml
index f71579cc5a3..bd5a3c38b6f 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml
@@ -356,6 +356,26 @@
</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
point="org.eclipse.ui.menus">
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/AddLocalsExpressionCommandHandler.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/AddLocalsExpressionCommandHandler.java
new file mode 100644
index 00000000000..7d35e745ece
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/AddLocalsExpressionCommandHandler.java
@@ -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$
+ }
+}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/AddRegistersExpressionCommandHandler.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/AddRegistersExpressionCommandHandler.java
new file mode 100644
index 00000000000..8f800487f82
--- /dev/null
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/AddRegistersExpressionCommandHandler.java
@@ -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$
+ }
+}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/plugin.properties b/dsf/org.eclipse.cdt.dsf.ui/plugin.properties
index 2d4b8761371..d5e833e7b1d 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/plugin.properties
+++ b/dsf/org.eclipse.cdt.dsf.ui/plugin.properties
@@ -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
diff --git a/dsf/org.eclipse.cdt.dsf.ui/plugin.xml b/dsf/org.eclipse.cdt.dsf.ui/plugin.xml
index ff1d4933573..3e296015d9c 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/plugin.xml
+++ b/dsf/org.eclipse.cdt.dsf.ui/plugin.xml
@@ -256,6 +256,31 @@
<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
id="org.eclipse.cdt.dsf.debug.ui.expressionsView_updatePolicies"
@@ -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">

Back to the top