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

DSDP/DD/MultiContext UnlinkViewContextProposal

< DSDP‎ | DD
Revision as of 04:11, 17 September 2007 by Jamesblackburn+eclipse.gmail.com (Talk | contribs) (Comments: -- Views per variable)

Overview

This is a proposal to change the workflow of selecting the context for data displayed in the standard debug views. These views include: Variables, Registers, Expressions, Memory, and possibly the Console views. This proposal builds on the previous efforts to improve multi-context debugging workflow: bug 145635 (Support for debug view pin & clone).

Goals

  • Allow user to switch the active context of a debug view without leaving the view.
  • Allow user to switch the active context of a debug view and without having to have the Launch view visible.
  • Allow user to have multiple instances of debug views open and showing data from different contexts side-by-side.
  • Avoid breaking any established UI paradigms with respect to views' interaction.

New UI Components and Workflow changes

Debug context selection dialog

A new selection dialog would allow user to choose the input context of a debug view. When the debug context selection dialog would open it would show a tree viewer where the top nodes are the participating debug context providers, and the sub-trees under the providers would be the contexts available for selection. Platform will provide the Launch Manager as the standard debug context provider, but others, such as Target Manager could also be shown. User would select the desired context in the dialog and press OK, to set the new input context to the view.

The debug context selection dialog should have a dedicated key binding and a tool-bar button or view menu item.

Link button in standard debug views

The standard debug views should all have a link toggle button on their toolbars. If the link button is down (default), the view context should follow the active window debug context as is does currently. If the link button is up, the input context of the debug the view should not change unless explicitly changed by the user. Selecting a new context using the debug context selection dialog would automatically un-link the view from window selection.

Content description in standard debug views

With the debug views able to select their own input context and with the Launch view possibly hidden or absent, it may be difficult to determine what is the current context of a given debug view. To address this problem, the content description of the view should be activated whenever a debug view is showing contents from a context that is different from the currently selected window context.

The content description of a view is currently limited to showing only text. To make it more useful for this feature, it should be extended to show an icon as well.

Multiple instances of standard debug views

Standard debug views should be configured to allow multiple instances of views to be opened. A toolbar button (or view menu item) should be added to easily open a new instance of the view. The memory view already supports this feature.

Setting active context for editors

When debugging, the editor is still the most important view on the screen. Just as in other debug views, the user needs to be able to focus to a different stack frame, thread, or process without leaving the editor. So just as in other debug views, user should be able to bring up the context selection dialog and jump to a different debug context. The status bar should display the current active context in the editor.

Deemphasizing the Launch view

Currently the debug view is essential to any debugging activity, because it drives the context of all other debug views. However, with the views and the editor being able to drive their own context, the Launch view should no longer be as critical to the standard work-flow. There are a few changes that should be made to better position the Launch view in the new workflow:

  • Move the run control actions to the global tool bar.
  • If the Launch view is closed, the editor should still react to breakpoint-hit and suspended events and open the appropriate source file.
  • Add a link button in the Launch view itself.
    • When depressed the Launch view should follow context from other views.
    • When up, the Launch view selection should not change, even for suspended events.

APIs

New context event: DebugContextEvent.CONTENT

In this feature proposal, views are be able to keep a given context as input even after that context is no longer active with a provider. The implication of this is that a given debug view can have an input context configured, which eventually gets terminated, removed, or otherwise becomes invalid. In this case, the debug view needs to be able to able to discover when a given context becomes invalid and change its input context as to avoid displaying stale data.

To facilitate this, the debug context providers should issue DebugContextEvent.STATE events for any context monitored by the given provider, not just for the active context. Also, the providers should issue a DebugContextEvent.CONTENT event whenever a sub-tree of a model changes in the given provider. The view can listen to these events and update as necessary.

IDebugContextProvider.getPresentationContext()

In a situation when:

  1. a debug view is un-linked from a provider,
  2. and it its input context is set to a given element which came from a given provider,
  3. the input context becomes invalid due to a DebugContextEvent.CONTENT event,

the debug view should be able to use the IElementMementoProvider of the input context elements in order to find and select a new context, which is equivalent (has the same memento) to the one that became invalid. This would be useful, for example, to keep focused on a stack frame while stepping.

In order to implement this, the debug context provider should have a method to retrieve the IPresentationContext used by the provider, so that the debug view may construct IElementMenentoProvider requests properly.

Debug context selection dialog

Debug context mechanism allows for multiple context providers to be present, which are registered with the IDebugContextService.addContextProvider() call. However, the debug selection dialog should be able to operate even if the debug view and other debug context providers are not open. To address this, a new interface will be needed:

public interface IDebugContextRoot {
    Object getRootElement();
}

To allow the lazy loading of IDebugContextRoot implementations, an extension point should also be provided to register context roots. When the context selection dialog is first opened the context root would be instantiated.

The root element returned by getRootElement() could then be used in the selection dialog to populate the contents of the dialog using the flexible hierarchy APIs (IElementContentProvider). After a selection is made in the dialog to set a view context, the debug view will need to install a IModelProxy on the root element of the context root and any children in order to generate proper debug context events. Registering model procies will allow the view to detect when the selected input context becomes invalid.

Alternative Design

One problem with the above design is that flexible hierarchy adapters for the elements originating from getRootElement() would need to support a new presentation context, coming from the selection dialog. This would mean a wide sweeping change to the existing model adapters.

To address this, the Debug context selection dialog could be split into two parts:

  1. A drop-down selection control allowing user to choose the IDebugContextRoot
  2. A tree viewer with the elements' hierarchy.

Another method would be added to the IDebugContextRoot: IPresentationContext getPresentationContext().

This design also has the added advantage in that the extension points providing IDebugContextRoot would not have to be invoked until the user chose the given root in the drop down.

IDebugContextService behavior changes

Better support for "part ID" context listeners

The standard debug views are listeners to the events coming from the window debug context service. Besides the input into the view, the active context returned by context service is used by actions which are contributed to the debug views. To control their context, debug views need to register their own providers with the window service using the IDebugContextService.addDebugContextProvider() method. View context listeners (e.g. view actions) can register themselves as listeners to context events using addDebugContextListener(IDebugContextListener listener, String partId). However, currently listeners registered this way will not receive any events if there is no provider registered for that ID. Since the views need to change between having their own provider and listening to the window context, I propose the following change to the debug context service:

  • Listeners registered using addDebugContextListener(IDebugContextListener listener, String partId) should receive active window context events if there is no provider registered with the given ID.

Default context provider

There should be a default context provider (provider with no part ID) registered in every window. This debug context provider would be responsible for the active context of the editors which implies the following change:

  • The debug view should no longer drive the source display, instead the default context provider should use the ISourceDisplay adapters in response to debug model events.

Finally, since the default context provider will be much more important, I propose another change:

  • Whenever in a view which does not have its own debug context provider, the active window context will be driven by the default context provider.

Comments

Please add your comments here. I will also summarize any email discussion here as well.


One feature which Eclipse lacks (and most other debuggers support) is the ability to view a variable in its own window. It would be nice if by doube clicking (or some right click Action), a new variable view appeared for the variable. This could then be layed side by side with another variable view from another core so comparisons could be made.

The use cases for this are many: in the embedded C world there are often a number of large control structs plus a large number of other variables which may be interesting. Currently it's impossible to look at one variable which resides at the top of the view, while keeping an eye on another variable at the bottom of a view -- especially a problem if an expanded struct fills the entire view (the view collaping at random points during stepping doesn't help either...)! Your two variables view goes some way to redressing that problem, but it would be nice if the solution were more generic.

So in addition to being able to tie multiple views to various debug contexts, it would be nice too if the views were liberated further and could be used to display just a subset of the variables (akin to register groups -- but with fewer dialogs to create...). --James Blackburn

Back to the top