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

Bug 328883

Summary: AbstractCachingVMProvider throws ClassCastException
Product: [Tools] CDT Reporter: Dobrin Alexiev <dalexiev>
Component: cdt-debug-dsfAssignee: Pawel Piech <pawel.1.piech>
Status: VERIFIED FIXED QA Contact: Pawel Piech <pawel.1.piech>
Severity: normal    
Priority: P3 CC: cdtdoug, marc.khouzam
Version: 8.0Flags: pawel.1.piech: review? (Randy.Rohrbach)
marc.khouzam: review+
Target Milestone: 7.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix.
cdtdoug: iplog-
Corrected fix. cdtdoug: iplog-

Description Dobrin Alexiev CLA 2010-10-27 16:02:01 EDT
Build Identifier: 

I setup my Eclipse workspace against the latest CDT/DFS and I've got the following exception when I start a GDB session using a debug session to Cygwin.

Caused by: java.lang.ClassCastException: org.eclipse.core.runtime.Status
	at org.eclipse.cdt.dsf.ui.viewmodel.update.AbstractCachingVMProvider$7.handleCompleted(AbstractCachingVMProvider.java:1213)
	at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:291)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	... 23 more

I noticed that at that moment the exception getStatus() returned 
Status CANCEL: unknown code=1  null

This is the line of the cast: 
PropertiesUpdateStatus missUpdateStatus = (PropertiesUpdateStatus)getStatus();

Reproducible: Always
Comment 1 Pawel Piech CLA 2010-10-28 15:47:01 EDT
Created attachment 181987 [details]
Fix.

Sorry about that.  I should know better than make such an assumption.
Comment 2 Pawel Piech CLA 2010-10-28 15:48:58 EDT
I committed the fix.  Dobrin please verify.
Comment 4 Dobrin Alexiev CLA 2010-10-29 11:19:04 EDT
Thanks Pawel. The exception is gone.
Comment 5 Pawel Piech CLA 2010-11-30 17:44:30 EST
Created attachment 184196 [details]
Corrected fix.

(In reply to bug 321932 comment #11)
> I'm getting an assertion pretty often with this fix.  I'm not sure if it is
> something that DSF-GDB was always doing wrong or if the assert made an wrong
> assumption.
> 
> Any opinion?
> 
> ...
 
The new exception is a side effect of my fix for this bug.  After reviewing the changes a little while I found additional problems my my recent changes.  This patch fixes that and adds a guard against the class cast exception.
Comment 6 Pawel Piech CLA 2010-11-30 17:47:56 EST
I applied the corrected fix.  Randy can you please review my changes.
Comment 7 Pawel Piech CLA 2010-11-30 17:48:36 EST
Marc, can you verify whether the assertion error goes away for you.  Thanks!
Comment 9 Marc Khouzam CLA 2010-12-01 09:03:23 EST
(In reply to comment #7)
> Marc, can you verify whether the assertion error goes away for you.  Thanks!

Seems to be gone.  Thanks for the quick fix!