[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[Cdt-launch-inbox] [Bug 236847] New: Debug launching of non-buildable project in CDT 4 may fail
|
https://bugs.eclipse.org/bugs/show_bug.cgi?id=236847
Product/Component: CDT / cdt-launch
Summary: Debug launching of non-buildable project in CDT 4 may
fail
Product: CDT
Version: 4.0.3
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P3
Component: cdt-launch
AssignedTo: cdt-launch-inbox@xxxxxxxxxxx
ReportedBy: dorascatalin@xxxxxxxxx
Build ID: M20080221-1800
Steps To Reproduce:
1. Create a CDT project that you have no intention to rebuild, and also doesn't
have any support for build included (we don't have a makefile).
The project is a new C or C++ project -> Makefile Project and a selected
toolchain.
2. Leave the check-box
"Build (if required) before launching" checked at
Window->Preferences->Run/Debug->Launching
3. When trying to launch a debug session you will get a NullPointerException
java.lang.NullPointerException
at
org.eclipse.cdt.launch.AbstractCLaunchDelegate.setBuildConfiguration(AbstractCLaunchDelegate.java:565)
at
org.eclipse.cdt.launch.AbstractCLaunchDelegate.buildForLaunch(AbstractCLaunchDelegate.java:541)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:727)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
so you can not continue with the launch process
More information:
In org.eclipse.cdt.launch.AbstractCLaunchDelegate.setBuildConfiguration() we
have the code:
if (buildConfigID.length() > 0 && projDes != null)
{
ICConfigurationDescription buildConfiguration =
projDes.getConfigurationById(buildConfigID);
buildConfiguration.setActive();
CDTPropertyManager.performOk(null);
}
buildConfiguration here is still null after the initialization in our case, so
we get a NullPointerException.
In order to fix this issue, we only do another check on the buildConfiguration
variable
if (buildConfigID.length() > 0 && projDes != null)
{
ICConfigurationDescription buildConfiguration =
projDes.getConfigurationById(buildConfigID);
// Added code: check if not null.
if (buildConfiguration != null){
buildConfiguration.setActive();
CDTPropertyManager.performOk(null);
}
}
--
Configure bugmail: https://bugs.eclipse.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.