Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326867

Summary: debug view messed up on terminate
Product: [Tools] CDT Reporter: Vladimir Prus <vladimir.prus>
Component: cdt-debug-dsf-gdbAssignee: Project Inbox <cdt-debug-dsf-gdb-inbox>
Status: CLOSED INVALID QA Contact: Marc Khouzam <marc.khouzam>
Severity: normal    
Priority: P3 CC: pawel.1.piech
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Screenshot of the problem
none
Fix none

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 :-)