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

Bug 112683

Summary: NPE when setting breakpoint in file where source is unavailable
Product: [Tools] CDT Reporter: Oyvind Harboe <oyvind.harboe>
Component: cdt-debugAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0.1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Oyvind Harboe CLA 2005-10-14 14:50:13 EDT
Index: CBreakpointManager.java
===================================================================
RCS file:
/home/tools/org.eclipse.cdt-debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java,v
retrieving revision 1.55
diff -u -r1.55 CBreakpointManager.java
--- CBreakpointManager.java	6 Sep 2005 20:19:04 -0000	1.55
+++ CBreakpointManager.java	14 Oct 2005 18:49:33 -0000
@@ -189,6 +189,7 @@
 					String sourceHandle = file;
 					if ( !isEmpty( file ) ) {
 						Object sourceElement = getSourceElement( file );
+						// FIX!!!! getSourceElement() can return "null"....
 						sourceHandle = ( sourceElement instanceof IFile ) ?
((IFile)sourceElement).getLocation().toOSString() :
((IStorage)sourceElement).getFullPath().toOSString();
 						return sourceHandle.equals(
((ICLineBreakpoint)breakpoint).getSourceHandle() ) && location.getLineNumber()
== ((ICLineBreakpoint)breakpoint).getLineNumber(); 
 					}
Comment 1 Chris Recoskie CLA 2005-10-14 15:23:10 EDT
Just a comment... you should attach your patch properly to the Bugzilla entry 
as a patch attachment.  This makes the due dilligence on tracking down 
contributors easier.  Doug has asked everyone to do this.
Comment 2 Oyvind Harboe CLA 2005-10-14 15:39:00 EDT
(In reply to comment #1)
> Just a comment... you should attach your patch properly to the Bugzilla entry 
> as a patch attachment.

I do for all patches.

>  This makes the due dilligence on tracking down 
> contributors easier.  Doug has asked everyone to do this.

I should have added a comment. 

I didn't submit a patch, just an awkard form of a source file and line number
reference :-)

The only thing I added was a comment on where the culprit was at:

// FIX!!!! getSourceElement() can return "null"....
Comment 3 Nobody - feel free to take it CLA 2005-10-14 16:32:56 EDT
This is known issue (probably it's a duplicate of  
https://bugs.eclipse.org/bugs/show_bug.cgi?id=111828). I've already had a fix 
on machine, but I haven't had a time to submit changes. 
Comment 4 Nobody - feel free to take it CLA 2005-10-19 17:19:17 EDT

*** This bug has been marked as a duplicate of 111828 ***