Bug 230932 - [debug view] When a stack frame is selected another thread suspending causes the selection to change.
Summary: [debug view] When a stack frame is selected another thread suspending causes ...
Status: CLOSED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf (show other bugs)
Version: 0 DD 1.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: DD 1.1   Edit
Assignee: Randy Rohrbach CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-05-07 12:52 EDT by Pawel Piech CLA
Modified: 2009-01-07 17:29 EST (History)
2 users (show)

See Also:


Attachments
Implement IModelSelectionPolicy (12.71 KB, patch)
2008-05-23 07:08 EDT, Anton Leherbauer CLA
no flags Details | Diff
Minor correction (+committed) (12.71 KB, patch)
2008-05-23 07:11 EDT, Anton Leherbauer CLA
pawel.1.piech: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Piech CLA 2008-05-07 12:52:22 EDT
The desired behavior (implemented by default by JDT, CDT, etc) is that if a stack frame is already selected, another thread suspending will NOT change the selection in Debug view.  This is also true during launching, when numerous events cause the selection to change.  

To fix this bug, DSF needs to implement IModelSelectionPolicy.
Comment 1 Anton Leherbauer CLA 2008-05-23 07:08:22 EDT
Created attachment 101714 [details]
Implement IModelSelectionPolicy

Implementation follows platform's DefaultSelectionPolicy.
Comment 2 Anton Leherbauer CLA 2008-05-23 07:11:16 EDT
Created attachment 101715 [details]
Minor correction (+committed)

The previous patch was not correct. I forgot to remove a comment.
Comment 3 Pawel Piech CLA 2008-05-23 18:47:31 EDT
Thanks Toni, I haven't had time to look at your patch today.  I'll review it next week.
Comment 4 Pawel Piech CLA 2008-05-28 14:29:49 EDT
Thanks Toni!
I applied the patch as is with one minor addition:

    public ISelection replaceInvalidSelection(ISelection invalidSelection, ISelection newSelection) {
        if (invalidSelection instanceof ITreeSelection) {
            ITreeSelection treeSelection = (ITreeSelection)invalidSelection;
            if (treeSelection.getPaths().length == 1) {
                TreePath path = treeSelection.getPaths()[0];
                return new TreeSelection(path.getParentPath());
            }
        }
        return newSelection;
    }

We use this change in Wind River Workbench so that if a thread is resumed and a stack frame is selected, the parent element (the thread) is automatically selected.  Unfortunately this doesn't work if the parent is also removed.

Randy please review.
Comment 5 Randy Rohrbach CLA 2008-05-28 16:45:35 EDT
Looks good. Scary thing is it is starting to make more sense now.

Randy
Comment 6 Pawel Piech CLA 2009-01-07 15:55:38 EST
DD 1.1 reelased!