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

Bug 334940

Summary: NPE in GdbPlugin.shutdownActiveLaunches() during simple junit tests
Product: [Tools] CDT Reporter: John Cortell <john.cortell>
Component: cdt-debug-dsf-gdbAssignee: John Cortell <john.cortell>
Status: RESOLVED FIXED QA Contact: Marc Khouzam <marc.khouzam>
Severity: normal    
Priority: P3 CC: cdtdoug, pawel.1.piech
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix john.cortell: iplog-

Description John Cortell CLA 2011-01-20 14:56:32 EST
If you're running a simple junit test method (or class) where there is no debug session (say you're just testing a set of utilities), then the debug platform plugins don't get loaded. However, GdbPlugin.shutdownActiveLaunches() assumes they have and causes an NPE. A simple reference check is needed to avoid the NPE.
Comment 1 John Cortell CLA 2011-01-20 15:01:50 EST
Created attachment 187233 [details]
Fix

Committed to HEAD (trivial fix; no review requested)
Comment 2 CDT Genie CLA 2011-01-20 15:23:01 EST
*** cdt cvs genie on behalf of jcortell ***
Bug 334940: NPE in GdbPlugin.shutdownActiveLaunches() during simple junit tests

[*] GdbPlugin.java 1.4 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/GdbPlugin.java?root=Tools_Project&r1=1.3&r2=1.4
Comment 3 Marc Khouzam CLA 2011-01-21 13:21:52 EST
Should this be marked as fixed?
Comment 4 John Cortell CLA 2011-01-21 16:43:39 EST
Fixed.