--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/BuildConfigurationData.java Wed Sep 15 17:34:04 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/BuildConfigurationData.java Wed Sep 15 18:12:43 2010 -0500
@@ -316,7 +316,7 @@
try {
ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project);
if (projDes != null) {
- ICConfigurationDescription configDes = projDes.getConfigurationById(((CarbideBuildConfiguration)carbideBuildConfig).getBuildContext().getConfigurationID());
+ ICConfigurationDescription configDes = projDes.getConfigurationById(carbideBuildConfig.getBuildContext().getConfigurationID());
if (configDes != null) {
ICStorageElement storage = configDes.getStorage(CONFIG_DATA_CACHE, false);
if (storage != null) {
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildManager.java Wed Sep 15 17:34:04 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildManager.java Wed Sep 15 18:12:43 2010 -0500
@@ -343,7 +343,7 @@
CLanguageData languageData = null;
ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(config.getCarbideProject().getProject());
if (projDes != null) {
- ICConfigurationDescription configDes = projDes.getConfigurationById(config.getDisplayString());
+ ICConfigurationDescription configDes = projDes.getConfigurationById(config.getBuildContext().getConfigurationID());
if (configDes != null) {
CConfigurationData configData = configDes.getConfigurationData();
if (configData != null && configData instanceof BuildConfigurationData) {
@@ -360,7 +360,7 @@
}
}
}
-
+
EpocEngineHelper.addIncludedFilesFromBldInf(cpi, config, cpi.getAbsoluteBldInfPath(), pathList);
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Wed Sep 15 17:34:04 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Wed Sep 15 18:12:43 2010 -0500
@@ -36,17 +36,25 @@
import org.eclipse.cdt.core.settings.model.extension.CLanguageData;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.core.runtime.content.IContentTypeSettings;
+import org.eclipse.core.runtime.jobs.Job;
import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
import com.nokia.carbide.cdt.builder.EpocEngineHelper;
import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
+import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
import com.nokia.carbide.cpp.epoc.engine.model.sbv.ISBVView;
import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine;
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildContext;
@@ -140,7 +148,30 @@
}
if (cacheBuilt) {
- persistCache();
+
+ // Bug 12078: persisting the cache requires setting the project
+ // description, or else it gets thrown away (!).
+ // But we must save the cache in a workspace job because this code
+ // is usually called when the project description is being read for
+ // the first time (thus saving just throws an exception).
+ Job job = new Job("Saving Carbide indexer cache for " + carbideBuildConfig.toString()) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ persistCache(monitor);
+
+ return Status.OK_STATUS;
+ }
+
+ };
+ job.setRule(ResourcesPlugin.getWorkspace().getRoot());
+ job.setSystem(true);
+ job.setPriority(Job.LONG);
+ job.schedule(5000);
+ // This scheduling delay is a gross HACK: WorkspaceModelProvider#saveStorage()
+ // has had and still has problems with deadlocks on saving
+ // model content. This job exacerbates it unless we wait a
+ // while before locking the workspace.
}
switch(kind) {
@@ -333,13 +364,20 @@
cacheTimestamp = System.currentTimeMillis();
}
- private void persistCache() {
+ private void persistCache(IProgressMonitor monitor) {
// persist the cache between IDE launches.
+ if (!isValid())
+ return;
try {
- final IProject project = carbideBuildConfig.getCarbideProject().getProject();
+ ICarbideProjectInfo carbideProject = carbideBuildConfig.getCarbideProject();
+ if (carbideProject == null)
+ return;
+ final IProject project = carbideProject.getProject();
+ if (project == null)
+ return;
ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project);
if (projDes != null) {
- ICConfigurationDescription configDes = projDes.getConfigurationById(carbideBuildConfig.getDisplayString());
+ ICConfigurationDescription configDes = projDes.getConfigurationById(carbideBuildConfig.getBuildContext().getConfigurationID());
if (configDes != null) {
String includesCacheValue = "";
for (ICLanguageSettingEntry inc : includeEntries) {
@@ -370,6 +408,8 @@
filesCacheValue += file.getAbsolutePath() + ENTRY_DELIMTER;
}
storage.setAttribute(FILES_CACHE, filesCacheValue);
+
+ CoreModel.getDefault().setProjectDescription(project, projDes, true, monitor);
}
}
} catch (CoreException e) {
@@ -386,7 +426,7 @@
try {
ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project);
if (projDes != null) {
- ICConfigurationDescription configDes = projDes.getConfigurationById(carbideBuildConfig.getDisplayString());
+ ICConfigurationDescription configDes = projDes.getConfigurationById(carbideBuildConfig.getBuildContext().getConfigurationID());
if (configDes != null) {
ICStorageElement storage = configDes.getStorage(CONFIG_DATA_CACHE, false);
if (storage != null) {
@@ -484,7 +524,11 @@
}
public void forceRebuildCache() {
- forceRebuildCache = true;
+ // only force rebuild if there was something loaded already --
+ // we get here on startup too when first hooking up resource listeners
+ if (includeEntries != null && macroEntries != null && cacheFileSource != null) {
+ forceRebuildCache = true;
+ }
}
@Override
--- a/connectivity/com.nokia.tcf/src/com/nokia/tcf/impl/TCAPIConnection.java Wed Sep 15 17:34:04 2010 -0500
+++ b/connectivity/com.nokia.tcf/src/com/nokia/tcf/impl/TCAPIConnection.java Wed Sep 15 18:12:43 2010 -0500
@@ -441,6 +441,7 @@
}
if (this.monitorThread != null) {
this.stopTCFMonitorThread = true;
+ this.monitorThread.stop = true;
try {
this.monitorThread.join();
} catch (InterruptedException e) {
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/LaunchWizardData.java Wed Sep 15 17:34:04 2010 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/LaunchWizardData.java Wed Sep 15 18:12:43 2010 -0500
@@ -417,10 +417,17 @@
public Boolean isSysTRKConnection() {
IConnectedService connectedService = getConnectedService();
if (connectedService instanceof IConnectedService2) {
+ // C3TRK: old name
String value = ((IConnectedService2) connectedService).getProperties().get("is-system-trk"); //$NON-NLS-1$
if (value != null) {
return Boolean.parseBoolean(value);
}
+
+ // new name
+ value = ((IConnectedService2) connectedService).getProperties().get("is-system-debugger"); //$NON-NLS-1$
+ if (value != null) {
+ return Boolean.parseBoolean(value);
+ }
}
return null;
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/ModelProviderThreadTests.java Wed Sep 15 17:34:04 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/ModelProviderThreadTests.java Wed Sep 15 18:12:43 2010 -0500
@@ -263,7 +263,7 @@
// can't actually validate -- we have no idea whether writers'
// commits have come in order or not, since one writer may have
// been out-of-sync and had to retry its commit late.
- validate(builder.toString());
+ //validate(builder.toString());
} finally {
view.dispose();
}
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestViewDataCache.java Wed Sep 15 17:34:04 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestViewDataCache.java Wed Sep 15 18:12:43 2010 -0500
@@ -459,7 +459,10 @@
b.start();
while (System.currentTimeMillis() < timeout) {
- Thread.sleep(100);
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ }
}
a.interrupt();
@@ -526,7 +529,10 @@
b.start();
while (System.currentTimeMillis() < timeout) {
- Thread.sleep(100);
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ }
}
a.interrupt();
@@ -606,7 +612,11 @@
b.start();
while (System.currentTimeMillis() < timeout) {
- Thread.sleep(100);
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+
+ }
}
a.interrupt();