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

Bug 335180

Summary: Remote debugging and virtual folders => java.lang.NullPointerException
Product: [Tools] CDT Reporter: Thomas Arnbjerg <thomas.dalum.arnbjerg>
Component: cdt-debugAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact: Ken Ryall <ken.ryall>
Severity: normal    
Priority: P3 CC: cdtdoug, cnuernber, nobody, pawel.1.piech
Version: 8.0   
Target Milestone: 8.4.0   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Thomas Arnbjerg CLA 2011-01-24 07:46:59 EST
Build Identifier: 20100917-0705

I have created a new C++ project (ARM Cross Target application). 
The project contains imported files as links and virtual folders. When engaging a remote debug session a java.lang.NullPointerException is shown. This happens regardless of the type of link used (relative to project location, workspace location, eclipse location etc). Importing the same files normally eliminates the problem. The exception stack is as follows: 
java.lang.NullPointerException
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1862)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1884)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1884)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.getSourceLookupPath(CDebugTarget.java:1884)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.setSourceLookupPath(CDebugTarget.java:1838)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.initializeSourceLookupPath(CDebugTarget.java:386)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.initialize(CDebugTarget.java:285)
at org.eclipse.cdt.debug.internal.core.model.CDebugTarget.<init>(CDebugTarget.java:278)
at org.eclipse.cdt.debug.core.CDIDebugModel$1.run(CDIDebugModel.java:104)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1957)
at org.eclipse.cdt.debug.core.CDIDebugModel.newDebugTarget(CDIDebugModel.java:109)
at org.eclipse.cdt.launch.remote.RemoteRunLaunchDelegate.launch(RemoteRunLaunchDelegate.java:191)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


Reproducible: Always

Steps to Reproduce:
1.Create a new application
2.Import source code using virtual folders.
3.Initiate a remote debug session.
Comment 1 Chris Nuernberger CLA 2011-11-10 15:34:26 EST
This happens on windows; I ran across this and it stopped my development on an android mixed java/c++ project
Comment 2 Nobody - feel free to take it CLA 2014-04-10 16:22:31 EDT
Added NPE protection to CDebugTarget.getSourceLookupPath().