Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

CDT/Obsolete/MultiCoreDebugWorkingGroup/ExpressionWorkingSets

< CDT‎ | Obsolete‎ | MultiCoreDebugWorkingGroup
Revision as of 13:25, 11 April 2012 by Abeerbagul.gmail.com (Talk | contribs) (Add new expression)

Spec describing Working Sets for Expressions

Overview

The existing Expressions view shows all expressions present in the workspace as a simple list. Sometimes the user has multiple projects in his workspace, and has created expressions for all of them. While debugging a single project, it is inconvenient to see all those expressions in the view which are not relevant for this project. The view tries to evaluate all expressions, and most of them fail with an error message.

Working sets give us an elegant way to group relevant expressions together, and show only those expressions which are applicable for the project being debugged currently.

The user can define working sets and assign expressions to each working set. He/she can assign the same expression to multiple working sets. Each expression view will use some or all of the working sets.

This spec is part of Bug 372181 https://bugs.eclipse.org/bugs/show_bug.cgi?id=372181

This spec has evolved through the discussion in the above bug.

Specification

Working sets for expressions will be implemented using the standard eclipse working set UI. The Expression View will have two menuitems: Select Working Sets Deselect Working Sets

User can define a working set and assign expressions to it. A default working set "Others (no working set)" will always be present. This will be used to display all expressions which are not specifically assigned to any working set. It is not allowed to delete this default working set.

The user can apply multiple working sets to an Expression view. Any expressions which are not a part of the working sets applied on the view will be filtered out. A viewer filter will be defined and applied to the Expression view. This filter will be added when cdt starts, similar to how pin and clone is started (see class ViewIDCounterManager).

One column "Working Set" will be added to Expression view which will display the working set name to which the given expression is assigned. For unassigned expressions, it will display the name "Others (no working set)". This column can be currently contributed only for DSF debug sessions. We need a patch to the eclipse platform view to show this column when no debug sessions are active.

Add new expression

New expressions can be added thru the following ways:

  1. Click the node "Add new expression" in the view, and type an expression inline.
  2. Click the view toolbar button "Create a new watch expression" and type an expression in the popup dialog.
  3. Drag a variable from the Variables View
  4. Drag a register from the Registers View
  5. Drag selected text from the C Editor
  6. Select text in the C Editor, right click -> Add new expression... and click OK in the popup dialog after reviewing the expression.

If the Expression view has no working sets selected, the new expression will be added to eclipse expression manager and will simply become visible in the view. This is the default behavior of platform.

If the view has a single working set applied, the new expression will be added to eclipse expression manager, as well as it will be added to the selected working set.

If the Expression view has multiple working sets selected, a new expression can be handled in the following manner:

  1. Add the new expression to all the selected working sets.
  2. Open a popup dialog with a textbox where the user can edit the expression, and a checkbox list of all selected working sets, with the first working set pre-checked. The user can then click OK and the new expression will be added to eclipse expression manager as well as the checked working sets.
  3. Create a dialog similar to the "Select default working set" dialog for breakpoints. If the view has multiple working sets, and no default working set, the first time a new expression is added, this dialog will open, prompting the

user to select a default working set. The new expression will be added to this working set. Further new expressions will be added to this working set.

  1. Maintain a built in working set "Others (no working set)", which is not deletable. All expressions not assigned to any working set, will belong to this Others working set, and will be always visible in the Expression view. A new

expression will always be added to Others working set, and from here can be assigned to any working set.

Duplicate Expressions

The platform currently allows duplicate expressions to be created. Is this a bug or a feature? If it is a bug, we need to add a patch to eclipse debug to prevent the user from adding duplicate expressions. Duplicate expressions do not impact performance, they just confuse the user. In case the same expression is assigned to multiple working sets, the expression will appear multiple times in the Expression View. We can filter out duplicates by adding a viewer filter to expression view, which filters out duplicate expressions. In this case, the expression will be visible for the first working set only. To filter duplicate expressions we will add a filter to "Show / hide duplicate expressions", controllable from a view menuitem in the Expression View and a workspace preference.

Assign an expression to a working set

The user can select an expression in the view, "Right-click > Assign Working Sets..." like JDT does in the Package Explorer. This workflow is a lot better than making assignments in a separate Workingset UI only.

Working Set subtrees

The Expression view can also implement the feature "Show Workingsets as Toplevel Elements" as in the Project Explorer. However, to implement this feature, we need to add a patch to the eclipse debug platform.

Import / Export of working sets

This is a mini feature which will also be supported via the addition of two menuitems on the Expression view menu. Import expressions Export expressions

Pinning

For pinning a working set to an active debug context, user can select an expression and "right click -> Pin to <active debug context>". This menuitem will have two submenus, "Pin select expression", "Pin <working set name>". In this case, view will remain unpinned, but it will display only the following expressions:

  1. Expressions / working sets pinned to the <active debug context>, i.e. the

selection in the debug view

  1. Unpinned expressions

The view should have a toggle toobar button or menuitem which toggles the view between two states:

  1. Show expressions / working sets pinned to <active debug contex>
  2. Show all expressions / working sets.

When the user pins an expression to the <active debug context>, the view will automatically toggle its state to show only pinned expressions. If the user has selected an expression from "Others (no working set)", the right click -> "Pin to active debug context" menuitem will not have any submenus, i.e. "Others (no working set)" itself cannot be pinned.

An expression can be pinned to multiple <active debug contexts>, so if an expression is not visible in the view, because it is pinned to some other debug context, user can open a checkbox dialog where all expressions are displayed, with info about the debug context(s) they are currently pinned to. This dialog box will display the active debug context in the title area. Expressions already pinned to the active debug context will be pre-checked. The user can check any existing expressions, and click ok to pin them to the active debug context.

This pinning is independent of the feature "pin and clone", and both features can be used simultaneously.

Pinning and Mylyn

TBD

Back to the top