Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] Programmatically selecting a frame in Debug View

> 
> Hello,
> 
> I would appreciate a suggestion as to how to programmatically select a
> frame in the Debug View. This is the use case: in a suspended state,
> the user selects a node on a canvas in a graphical editor. There is
> one-to one correspondence between the nodes on the canvas and the
> stack frames in the Debug View. What is a suggested way to broadcast
> this selection to the Debug View so that the corresponding stack frame
> is selected (and the Variables View updates for the new frame
> selection)?
> 
> Shall I go through IDebugContextManager, IDebugContextService,
> IDebugContextListener path, or through ISelectionProvider path?
> 
> Thank you.
> 

The context service/providers are not for controlling the selection. 
Context providers allow different workbench parts to have mutually 
exclusive debug contexts, and allow the debug actions to work on different 
contexts, based on which part has focus. Firing a context change does not 
change the selection, it updates action enabled state, for actions wired 
to that context.

Selection changes are historically controlled by debug events. For 
example, a thread suspend event expands/selects the top frame in the 
suspended thread. Since the flexible hierarchy was introduced, a model 
proxy can fire deltas to control the selection (and the model proxy for a 
standard debug model does this based on suspend events). You could provide 
a custom model proxy for you debugger that creates appropriate deltas to 
control the selection based on editor navigation. This does require using 
internal/provisional API.

Darin


Back to the top