mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 04:55:22 +02:00
use new cdescriptor operation for changes
This commit is contained in:
parent
0114d4cd78
commit
a85f27eed2
7 changed files with 140 additions and 87 deletions
|
@ -14,6 +14,7 @@ import junit.framework.TestSuite;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.ICDescriptor;
|
||||
import org.eclipse.cdt.core.ICDescriptorOperation;
|
||||
import org.eclipse.cdt.core.model.IBinary;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
|
@ -25,6 +26,7 @@ import org.eclipse.core.resources.IWorkspace;
|
|||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
|
@ -88,12 +90,14 @@ public class BinaryTests extends TestCase {
|
|||
|
||||
// since our test require that we can read the debug info from the exe whne must set the GNU elf
|
||||
// binary parser since the default (generic elf binary parser) does not do this.
|
||||
ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(testProject.getProject());
|
||||
desc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
desc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, "org.eclipse.cdt.core.GNU_ELF");
|
||||
ICDescriptorOperation op = new ICDescriptorOperation() {
|
||||
|
||||
// Reset the binary parser the paths may have change.
|
||||
CCorePlugin.getDefault().getCoreModel().resetBinaryParser(testProject.getProject());
|
||||
public void execute(ICDescriptor descriptor, IProgressMonitor monitor) throws CoreException {
|
||||
descriptor.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
descriptor.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, "org.eclipse.cdt.core.GNU_ELF");
|
||||
}
|
||||
};
|
||||
CCorePlugin.getDefault().getCDescriptorManager().runDescriptorOperation(testProject.getProject(), op, null);
|
||||
|
||||
if (testProject==null)
|
||||
fail("Unable to create project");
|
||||
|
|
|
@ -152,7 +152,7 @@ public class CPathEntryTest extends TestCase {
|
|||
// We always have at least two entries:
|
||||
// 1) the default sourceEntry becomes the project
|
||||
// 2) the default outputEntry becomes the project
|
||||
assertTrue("Expecting 3 pathentries", entries.length == (3 + 2));
|
||||
assertTrue("Expecting 5 pathentries", entries.length == (3 + 2));
|
||||
testProject.setRawPathEntries(null, null);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2004-03-19 David Inglis
|
||||
Update changing binary parser to use cdescriptor operation and remove call to deprecated call
|
||||
Added check before changes to prevent uneccessary changes of the .cdtproject file.
|
||||
* src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java
|
||||
* src/org/eclipse/cdt/ui/dialogs/CygwinPEBinaryParserPage.java
|
||||
* src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java
|
||||
|
||||
2004-03-19 Hoda Amer
|
||||
Fix for bug#54325 Refactor: Check for name collision
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
***********************************************************************/
|
||||
***********************************************************************/
|
||||
package org.eclipse.cdt.ui.dialogs;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -15,6 +15,7 @@ import java.util.Iterator;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.ICDescriptor;
|
||||
import org.eclipse.cdt.core.ICDescriptorOperation;
|
||||
import org.eclipse.cdt.core.ICExtensionReference;
|
||||
import org.eclipse.cdt.internal.ui.CUIMessages;
|
||||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||
|
@ -40,14 +41,14 @@ import org.eclipse.ui.help.WorkbenchHelp;
|
|||
|
||||
public class BinaryParserBlock extends AbstractBinaryParserPage {
|
||||
|
||||
private static final String PREFIX = "BinaryParserBlock"; // $NON-NLS-1$ //$NON-NLS-1$
|
||||
private static final String LABEL = PREFIX + ".label"; // $NON-NLS-1$ //$NON-NLS-1$
|
||||
private static final String DESC = PREFIX + ".desc"; // $NON-NLS-1$ //$NON-NLS-1$
|
||||
private static final String PREFIX = "BinaryParserBlock"; //$NON-NLS-1$
|
||||
private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$
|
||||
private static final String DESC = PREFIX + ".desc"; //$NON-NLS-1$
|
||||
|
||||
protected Combo comboBox;
|
||||
private HashMap idMap = new HashMap();
|
||||
private String initial;
|
||||
private Preferences fPrefs;
|
||||
HashMap idMap = new HashMap();
|
||||
String initial;
|
||||
Preferences fPrefs;
|
||||
|
||||
public BinaryParserBlock(Preferences prefs) {
|
||||
super(CUIPlugin.getResourceString(LABEL));
|
||||
|
@ -72,6 +73,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
|
|||
gd.grabExcessHorizontalSpace = true;
|
||||
comboBox.setLayoutData(gd);
|
||||
comboBox.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
getContainer().updateContainer();
|
||||
handleBinaryParserChanged();
|
||||
|
@ -109,29 +111,43 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
|
|||
monitor = new NullProgressMonitor();
|
||||
}
|
||||
monitor.beginTask(CUIMessages.getString("BinaryParserBlock.settingBinaryParser"), 2); //$NON-NLS-1$
|
||||
String selected = comboBox.getText();
|
||||
final String selected = comboBox.getText();
|
||||
if (selected != null) {
|
||||
if (initial == null || !selected.equals(initial)) {
|
||||
if (getContainer().getProject() != null) {
|
||||
ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(getContainer().getProject());
|
||||
desc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
desc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, (String) idMap.get(selected));
|
||||
ICDescriptorOperation op = new ICDescriptorOperation() {
|
||||
|
||||
public void execute(ICDescriptor descriptor, IProgressMonitor monitor) throws CoreException {
|
||||
if (initial == null || !selected.equals(initial)) {
|
||||
descriptor.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
descriptor.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, (String) idMap.get(selected));
|
||||
}
|
||||
monitor.worked(1);
|
||||
// Give a chance to the contributions to save.
|
||||
// We have to do it last to make sure the parser id
|
||||
// is save
|
||||
// in .cdtproject
|
||||
ICOptionPage page = getCurrentBinaryParserPage();
|
||||
if (page != null) {
|
||||
page.performApply(new SubProgressMonitor(monitor, 1));
|
||||
}
|
||||
}
|
||||
};
|
||||
CCorePlugin.getDefault().getCDescriptorManager().runDescriptorOperation(getContainer().getProject(), op, monitor);
|
||||
} else {
|
||||
if (initial == null || !selected.equals(initial)) {
|
||||
fPrefs.setValue(CCorePlugin.PREF_BINARY_PARSER, (String) idMap.get(selected));
|
||||
}
|
||||
initial = selected;
|
||||
}
|
||||
}
|
||||
monitor.worked(1);
|
||||
// Give a chance to the contributions to save.
|
||||
// We have to do it last to make sure the parser id is save
|
||||
// in .cdtproject
|
||||
super.performApply(new SubProgressMonitor(monitor, 1));
|
||||
|
||||
// Reset the binary parser the paths may have change.
|
||||
if (getContainer().getProject() != null)
|
||||
CCorePlugin.getDefault().getCoreModel().resetBinaryParser(getContainer().getProject());
|
||||
|
||||
ICOptionPage page = getCurrentBinaryParserPage();
|
||||
if (page != null) {
|
||||
page.performApply(new SubProgressMonitor(monitor, 1));
|
||||
}
|
||||
}
|
||||
initial = selected;
|
||||
}
|
||||
monitor.done();
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
***********************************************************************/
|
||||
***********************************************************************/
|
||||
|
||||
package org.eclipse.cdt.ui.dialogs;
|
||||
|
||||
|
@ -52,7 +52,9 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
protected Text fCPPFiltCommandText;
|
||||
protected Text fCygPathCommandText;
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performApply(org.eclipse.core.runtime.IProgressMonitor)
|
||||
*/
|
||||
public void performApply(IProgressMonitor monitor) throws CoreException {
|
||||
|
@ -67,11 +69,10 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
monitor.beginTask(CUIMessages.getString("BinaryParserPage.task.savingAttributes"), 1); //$NON-NLS-1$
|
||||
IProject proj = getContainer().getProject();
|
||||
if (proj != null) {
|
||||
String parserID = ""; //$NON-NLS-1$
|
||||
ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(proj);
|
||||
ICExtensionReference[] cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
if (cext.length == 0) {
|
||||
// The value was not save yet and we need to save it now
|
||||
// to apply the changes. Search the extension for our own ID
|
||||
if (cext.length > 0) {
|
||||
IPluginDescriptor descriptor = CUIPlugin.getDefault().getDescriptor();
|
||||
IExtensionPoint point = descriptor.getExtensionPoint("BinaryParserPage"); //$NON-NLS-1$
|
||||
IConfigurationElement[] infos = point.getConfigurationElements();
|
||||
|
@ -80,14 +81,12 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
String clazz = infos[i].getAttribute("class"); //$NON-NLS-1$
|
||||
String ego = getClass().getName();
|
||||
if (clazz != null && clazz.equals(ego)) {
|
||||
cdesc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
cdesc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, id);
|
||||
parserID = id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Try again.
|
||||
cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
}
|
||||
if (cext.length > 0) {
|
||||
for (int i = 0; i < cext.length; i++) {
|
||||
if (cext[i].getID().equals(parserID)) {
|
||||
String orig = cext[0].getExtensionData("addr2line"); //$NON-NLS-1$
|
||||
if (orig == null || !orig.equals(addr2line)) {
|
||||
cext[0].setExtensionData("addr2line", addr2line); //$NON-NLS-1$
|
||||
|
@ -101,6 +100,8 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
cext[0].setExtensionData("cygpath", cygpath); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Preferences store = getContainer().getPreferences();
|
||||
if (store != null) {
|
||||
|
@ -111,7 +112,9 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults()
|
||||
*/
|
||||
public void performDefaults() {
|
||||
|
@ -143,7 +146,9 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
fCygPathCommandText.setText((cygpath == null || cygpath.length() == 0) ? "cygpath" : cygpath); //$NON-NLS-1$;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
public void createControl(Composite parent) {
|
||||
|
@ -157,6 +162,7 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
|
||||
fAddr2LineCommandText = ControlFactory.createTextField(comp, SWT.SINGLE | SWT.BORDER);
|
||||
fAddr2LineCommandText.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent evt) {
|
||||
//updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
@ -164,6 +170,7 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
|
||||
Button button = ControlFactory.createPushButton(comp, CUIMessages.getString("BinaryParserPage.label.browse")); //$NON-NLS-1$
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent evt) {
|
||||
handleAddr2LineButtonSelected();
|
||||
//updateLaunchConfigurationDialog();
|
||||
|
@ -194,12 +201,14 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
fCPPFiltCommandText.setLayoutData(gd);
|
||||
fCPPFiltCommandText.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent evt) {
|
||||
//updateLaunchConfigurationDialog();
|
||||
}
|
||||
});
|
||||
button = ControlFactory.createPushButton(comp, CUIMessages.getString("BinaryParserPage.label.browse")); //$NON-NLS-1$
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent evt) {
|
||||
handleCPPFiltButtonSelected();
|
||||
//updateLaunchConfigurationDialog();
|
||||
|
@ -230,12 +239,14 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
fCygPathCommandText.setLayoutData(gd);
|
||||
fCygPathCommandText.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent evt) {
|
||||
//updateLaunchConfigurationDialog();
|
||||
}
|
||||
});
|
||||
button = ControlFactory.createPushButton(comp, CUIMessages.getString("BinaryParserPage.label.browse")); //$NON-NLS-1$
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent evt) {
|
||||
handleCygPathButtonSelected();
|
||||
//updateLaunchConfigurationDialog();
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
***********************************************************************/
|
||||
***********************************************************************/
|
||||
|
||||
package org.eclipse.cdt.ui.dialogs;
|
||||
|
||||
|
@ -50,7 +50,9 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
|
|||
protected Text fAddr2LineCommandText;
|
||||
protected Text fCPPFiltCommandText;
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performApply(org.eclipse.core.runtime.IProgressMonitor)
|
||||
*/
|
||||
public void performApply(IProgressMonitor monitor) throws CoreException {
|
||||
|
@ -64,11 +66,10 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
|
|||
monitor.beginTask(CUIMessages.getString("BinaryParserPage.task.savingAttributes"), 1); //$NON-NLS-1$
|
||||
IProject proj = getContainer().getProject();
|
||||
if (proj != null) {
|
||||
String parserID = ""; //$NON-NLS-1$
|
||||
ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(proj);
|
||||
ICExtensionReference[] cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
if (cext.length == 0) {
|
||||
// The value was not save yet and we need to save it now
|
||||
// to apply the changes. Search the extension for our own ID
|
||||
if (cext.length > 0) {
|
||||
IPluginDescriptor descriptor = CUIPlugin.getDefault().getDescriptor();
|
||||
IExtensionPoint point = descriptor.getExtensionPoint("BinaryParserPage"); //$NON-NLS-1$
|
||||
IConfigurationElement[] infos = point.getConfigurationElements();
|
||||
|
@ -77,14 +78,13 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
|
|||
String clazz = infos[i].getAttribute("class"); //$NON-NLS-1$
|
||||
String ego = getClass().getName();
|
||||
if (clazz != null && clazz.equals(ego)) {
|
||||
cdesc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
cdesc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, id);
|
||||
parserID = id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Try again.
|
||||
cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
}
|
||||
if (cext.length > 0) {
|
||||
for (int i = 0; i < cext.length; i++) {
|
||||
if (cext[i].getID().equals(parserID)) {
|
||||
|
||||
String orig = cext[0].getExtensionData("addr2line"); //$NON-NLS-1$
|
||||
if (orig == null || !orig.equals(addr2line)) {
|
||||
cext[0].setExtensionData("addr2line", addr2line); //$NON-NLS-1$
|
||||
|
@ -94,6 +94,8 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
|
|||
cext[0].setExtensionData("c++filt", cppfilt); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Preferences store = getContainer().getPreferences();
|
||||
if (store != null) {
|
||||
|
@ -103,7 +105,9 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
|
|||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults()
|
||||
*/
|
||||
public void performDefaults() {
|
||||
|
@ -131,7 +135,9 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
|
|||
fCPPFiltCommandText.setText((cppfilt == null || cppfilt.length() == 0) ? "c++filt" : cppfilt); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
public void createControl(Composite parent) {
|
||||
|
@ -145,6 +151,7 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
|
|||
|
||||
fAddr2LineCommandText = ControlFactory.createTextField(comp, SWT.SINGLE | SWT.BORDER);
|
||||
fAddr2LineCommandText.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent evt) {
|
||||
//updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
@ -152,6 +159,7 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
|
|||
|
||||
Button button = ControlFactory.createPushButton(comp, CUIMessages.getString("BinaryParserPage.label.browse")); //$NON-NLS-1$
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent evt) {
|
||||
handleAddr2LineButtonSelected();
|
||||
//updateLaunchConfigurationDialog();
|
||||
|
@ -182,12 +190,14 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
|
|||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
fCPPFiltCommandText.setLayoutData(gd);
|
||||
fCPPFiltCommandText.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent evt) {
|
||||
//updateLaunchConfigurationDialog();
|
||||
}
|
||||
});
|
||||
button = ControlFactory.createPushButton(comp, CUIMessages.getString("BinaryParserPage.label.browse")); //$NON-NLS-1$
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent evt) {
|
||||
handleCPPFiltButtonSelected();
|
||||
//updateLaunchConfigurationDialog();
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.util.zip.ZipFile;
|
|||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.CProjectNature;
|
||||
import org.eclipse.cdt.core.ICDescriptor;
|
||||
import org.eclipse.cdt.core.ICDescriptorOperation;
|
||||
import org.eclipse.cdt.core.model.IArchive;
|
||||
import org.eclipse.cdt.core.model.IArchiveContainer;
|
||||
import org.eclipse.cdt.core.model.IBinary;
|
||||
|
@ -53,12 +54,16 @@ public class CProjectHelper {
|
|||
|
||||
ICProject cproject = CCorePlugin.getDefault().getCoreModel().create(project);
|
||||
/* Try to guess at the correct binary parser.. elf or pe at this point.. */
|
||||
ICDescriptorOperation op = new ICDescriptorOperation() {
|
||||
|
||||
public void execute(ICDescriptor descriptor, IProgressMonitor monitor) throws CoreException {
|
||||
descriptor.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
String os = System.getProperty("os.name");
|
||||
boolean pe=(os.toLowerCase().indexOf("windows")!=-1);
|
||||
ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(project);
|
||||
desc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
desc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, pe?"org.eclipse.cdt.core.PE":"org.eclipse.cdt.core.ELF");
|
||||
CCorePlugin.getDefault().getCoreModel().resetBinaryParser(project);
|
||||
descriptor.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, pe?"org.eclipse.cdt.core.PE":"org.eclipse.cdt.core.ELF");
|
||||
}
|
||||
};
|
||||
CCorePlugin.getDefault().getCDescriptorManager().runDescriptorOperation(project, op, null);
|
||||
return cproject;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue