Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326867 - debug view messed up on terminate
Summary: debug view messed up on terminate
Status: CLOSED INVALID
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-03 11:03 EDT by Vladimir Prus CLA
Modified: 2010-10-03 22:20 EDT (History)
1 user (show)

See Also:


Attachments
Screenshot of the problem (15.22 KB, image/png)
2010-10-03 11:04 EDT, Vladimir Prus CLA
no flags Details
Fix (4.39 KB, patch)
2010-10-03 11:11 EDT, Vladimir Prus CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Prus CLA 2010-10-03 11:03:11 EDT
Build Identifier: 

1. Debug native "hello, world" application.
2. Select stack frame, right click, and select "Terminate"

Observe that the debug view shows the launch as terminated, but still shows thread and stack frame. This should not happen. Reproduces all the time.

Reproducible: Always
Comment 1 Vladimir Prus CLA 2010-10-03 11:04:18 EDT
Created attachment 180116 [details]
Screenshot of the problem

Observe that the thread is displayed as child of the 'gdb' element -- while normally, it's a child of "container" node. This fact is a key insight that leads to the forthcoming patch.
Comment 2 Vladimir Prus CLA 2010-10-03 11:11:59 EDT
Created attachment 180117 [details]
Fix

When debugging, the launch item in debug view has three children:
- "container", which has threads
- gdb
- program itself

After terminate, the "container" goes away, while the other two remain, in "terminated" state. The screenshot shows that children of "container" appear to be stuck under gdb. 

This is happening because when TreeModelViewProvider decides to update the new 0-th element, gdb, and calls doUpdateHasChildren, it cannot get no IElementContentProvider for GDBProcess, and apparently gets very upset and instead of clearing children, keeps the stale ones.

This patch fixes it by providing IElementContentProvider adapter for GDBProcess.
Comment 3 Marc Khouzam CLA 2010-10-03 11:41:27 EDT
Which platform are you using?
If you look at the screenshot attached to Bug 264895, it is exactly the same as the problem you are seeing.  This was fixed in the platform by bug 310497.
Comment 4 Vladimir Prus CLA 2010-10-03 12:48:15 EDT
I have whatever platform is in Helios, which identifies itself as 3.6.0.v20100427-9hF78GQHFvItsz0S5GyW7qqoQ6yMHokFS58. Is the fix more recent than that?
Comment 5 Marc Khouzam CLA 2010-10-03 13:09:05 EDT
That fix is part of Helios.
You wouldn't happen to have checked-out an old version of the platform plugins?
Comment 6 Vladimir Prus CLA 2010-10-03 13:58:32 EDT
It looks like I had something not-exactly-final-helios as my PDE. When I try with SR1, this bug is indeed gone.

Sorry for the false alarm.
Comment 7 Marc Khouzam CLA 2010-10-03 22:20:05 EDT
(In reply to comment #6)
> It looks like I had something not-exactly-final-helios as my PDE. When I try
> with SR1, this bug is indeed gone.
> 
> Sorry for the false alarm.

Good news :-)