Community
Participate
Working Groups
Steps to reproduce: 1. Start two debug sessions 2. Open two Variables view, pin the first view to a stack frame in the first session and the second view to a stack frame in the second session. 3. Select both stack frames in the Debug view. The second view shows the content from the first selection.
I think we use the first context of a multi-select. I don't believe we ever considered how to properly handled a multi-selection case.
(In reply to comment #1) > I think we use the first context of a multi-select. I don't believe we ever > considered how to properly handled a multi-selection case. It seems the first element of the selection is passed from the platform. I thought the second view wouldn't react to it because it is pinned to another context.
Perhaps we should blank out the view if there is a context that is not pinned to the view instance, or filter the selection before firing the event to the pinned view.
I am still behind on git :), need to catch up on git for creating patch and commit it back to head. Anyway, if you replace DebugEventFilterService#debugContextChanged with this piece of code, you won't see the second view change. public void debugContextChanged(DebugContextEvent event) { ISelection eventContext = event.getContext(); if (eventContext instanceof IStructuredSelection) { List<Object> filteredContextList = new ArrayList<Object>(); List<?> eventContextList = ((IStructuredSelection)eventContext).toList(); for (Object o : eventContextList) { if (fProvider.isPinnedTo(o)) { if (fProvider != event.getDebugContextProvider()) { filteredContextList.add(o); } } } if (filteredContextList.size() > 0) { fProvider.delegateEvent(new DebugContextEvent(fProvider, new StructuredSelection(filteredContextList), event.getFlags())); } } }
(In reply to comment #4) Thanks Patrick, I'll try it.
Created attachment 208443 [details] fix Mikhail, can you try out this patch?
Works fine. Thanks Patrick.
Verified by Mikhail. Committed to master.
*** cdt git genie on behalf of Patrick Chuong *** Bug 358135 - [Pin&Clone] Pinned view shows wrong content for multiple selection [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=349cdb089d6d56c6e7a8d8b2b5e86e608885b48c