mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
2004-12-02 Alain Magloire
Fix for 40081 Textfield to choose NM. Fix MacOX binary parser page. * src/org/eclipse/cdt/internal/ui/CUIMessages.properties. * src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java * src/org/eclipse/cdt/ui/dialogs/CygwinPEBinarParserPage.java * src/org/eclipse/cdt/ui/dialogs/MachOBinaryParserPage.java
This commit is contained in:
parent
cf4ae8ebfe
commit
1e1949ee20
5 changed files with 71 additions and 196 deletions
|
@ -1,3 +1,12 @@
|
|||
2004-12-02 Alain Magloire
|
||||
Fix for 40081
|
||||
Textfield to choose NM.
|
||||
Fix MacOX binary parser page.
|
||||
* src/org/eclipse/cdt/internal/ui/CUIMessages.properties.
|
||||
* src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java
|
||||
* src/org/eclipse/cdt/ui/dialogs/CygwinPEBinarParserPage.java
|
||||
* src/org/eclipse/cdt/ui/dialogs/MachOBinaryParserPage.java
|
||||
|
||||
2004-11-25 Alain Magloire
|
||||
Fix for PR 79327
|
||||
* src/org/eclipse/cdt/internal/ui/cview/CViewLabelProvider.java
|
||||
|
|
|
@ -39,6 +39,7 @@ BinaryParserPage.label.browse1=B&rowse...
|
|||
BinaryParserPage.label.browse2=Br&owse...
|
||||
BinaryParserPage.label.cppfiltCommand=c++filt Command:
|
||||
BinaryParserPage.label.cygpathCommand=cygpath Command:
|
||||
BinaryParserPage.label.nmCommand=nm Command:
|
||||
|
||||
AbstractErrorParserBlock.task.setErrorParser=Setting Error Parsers...
|
||||
ConvertProjectWizardPage.convertTo=Convert to C or C++
|
||||
|
|
|
@ -51,6 +51,7 @@ import org.eclipse.ui.help.WorkbenchHelp;
|
|||
|
||||
public class BinaryParserBlock extends AbstractBinaryParserPage {
|
||||
|
||||
private static final int DEFAULT_HEIGHT = 160;
|
||||
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$
|
||||
|
@ -194,7 +195,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
|
|||
Composite parserGroup = new Composite(composite, SWT.NULL);
|
||||
|
||||
GridData gd = new GridData();
|
||||
gd.heightHint = converter.convertHorizontalDLUsToPixels(150);
|
||||
gd.heightHint = converter.convertHorizontalDLUsToPixels(DEFAULT_HEIGHT);
|
||||
gd.horizontalAlignment = GridData.FILL;
|
||||
gd.grabExcessHorizontalSpace = true;
|
||||
gd.grabExcessVerticalSpace = true;
|
||||
|
|
|
@ -48,10 +48,12 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
public final static String PREF_ADDR2LINE_PATH = CUIPlugin.PLUGIN_ID + ".addr2line"; //$NON-NLS-1$
|
||||
public final static String PREF_CPPFILT_PATH = CUIPlugin.PLUGIN_ID + ".cppfilt"; //$NON-NLS-1$
|
||||
public final static String PREF_CYGPATH_PATH = CUIPlugin.PLUGIN_ID + ".cygpath"; //$NON-NLS-1$
|
||||
public final static String PREF_NM_PATH = CUIPlugin.PLUGIN_ID + ".nm"; //$NON-NLS-1$
|
||||
|
||||
protected Text fAddr2LineCommandText;
|
||||
protected Text fCPPFiltCommandText;
|
||||
protected Text fCygPathCommandText;
|
||||
protected Text fNMCommandText;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -66,6 +68,7 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
String addr2line = fAddr2LineCommandText.getText().trim();
|
||||
String cppfilt = fCPPFiltCommandText.getText().trim();
|
||||
String cygpath = fCygPathCommandText.getText().trim();
|
||||
String nm = fNMCommandText.getText().trim();
|
||||
|
||||
monitor.beginTask(CUIMessages.getString("BinaryParserPage.task.savingAttributes"), 1); //$NON-NLS-1$
|
||||
IProject proj = getContainer().getProject();
|
||||
|
@ -99,6 +102,10 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
if (orig == null || !orig.equals(cygpath)) {
|
||||
cext[i].setExtensionData("cygpath", cygpath); //$NON-NLS-1$
|
||||
}
|
||||
orig = cext[i].getExtensionData("nm"); //$NON-NLS-1$
|
||||
if (orig == null || !orig.equals(nm)) {
|
||||
cext[i].setExtensionData("nm", nm); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -108,6 +115,7 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
store.setValue(PREF_ADDR2LINE_PATH, addr2line);
|
||||
store.setValue(PREF_CPPFILT_PATH, cppfilt);
|
||||
store.setValue(PREF_CYGPATH_PATH, cygpath);
|
||||
store.setValue(PREF_NM_PATH, nm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -121,6 +129,7 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
String addr2line = null;
|
||||
String cppfilt = null;
|
||||
String cygpath = null;
|
||||
String nm = null;
|
||||
IProject proj = getContainer().getProject();
|
||||
Preferences store = getContainer().getPreferences();
|
||||
if (store != null) {
|
||||
|
@ -128,14 +137,17 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
addr2line = store.getString(PREF_ADDR2LINE_PATH);
|
||||
cppfilt = store.getString(PREF_CPPFILT_PATH);
|
||||
cygpath = store.getString(PREF_CYGPATH_PATH);
|
||||
nm = store.getString(PREF_NM_PATH);
|
||||
} else {
|
||||
addr2line = store.getDefaultString(PREF_ADDR2LINE_PATH);
|
||||
cppfilt = store.getDefaultString(PREF_CPPFILT_PATH);
|
||||
cygpath = store.getDefaultString(PREF_CYGPATH_PATH);
|
||||
nm = store.getDefaultString(PREF_NM_PATH);
|
||||
}
|
||||
fAddr2LineCommandText.setText((addr2line == null || addr2line.length() == 0) ? "addr2line" : addr2line); //$NON-NLS-1$;
|
||||
fCPPFiltCommandText.setText((cppfilt == null || cppfilt.length() == 0) ? "c++filt" : cppfilt); //$NON-NLS-1$;
|
||||
fCygPathCommandText.setText((cygpath == null || cygpath.length() == 0) ? "cygpath" : cygpath); //$NON-NLS-1$;
|
||||
fNMCommandText.setText((nm == null || nm.length() == 0) ? "nm" : nm); //$NON-NLS-1$;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -265,6 +277,45 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
label = ControlFactory.createLabel(comp, CUIMessages.getString("BinaryParserPage.label.nmCommand")); //$NON-NLS-1$
|
||||
gd = new GridData();
|
||||
gd.horizontalSpan = 2;
|
||||
label.setLayoutData(gd);
|
||||
|
||||
fNMCommandText = ControlFactory.createTextField(comp, SWT.SINGLE | SWT.BORDER);
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
fNMCommandText.setLayoutData(gd);
|
||||
fNMCommandText.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent evt) {
|
||||
//updateLaunchConfigurationDialog();
|
||||
}
|
||||
});
|
||||
button = ControlFactory.createPushButton(comp, CUIMessages.getString("BinaryParserPage.label.browse2")); //$NON-NLS-1$
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent evt) {
|
||||
handleCygPathButtonSelected();
|
||||
//updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
private void handleCygPathButtonSelected() {
|
||||
FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
|
||||
dialog.setText(CUIMessages.getString("BinaryParserPage.label.nmCommand")); //$NON-NLS-1$
|
||||
String command = fNMCommandText.getText().trim();
|
||||
int lastSeparatorIndex = command.lastIndexOf(File.separator);
|
||||
if (lastSeparatorIndex != -1) {
|
||||
dialog.setFilterPath(command.substring(0, lastSeparatorIndex));
|
||||
}
|
||||
String res = dialog.open();
|
||||
if (res == null) {
|
||||
return;
|
||||
}
|
||||
fNMCommandText.setText(res);
|
||||
}
|
||||
});
|
||||
|
||||
setControl(comp);
|
||||
initializeValues();
|
||||
}
|
||||
|
@ -273,6 +324,7 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
String addr2line = null;
|
||||
String cppfilt = null;
|
||||
String cygpath = null;
|
||||
String nm = null;
|
||||
IProject proj = getContainer().getProject();
|
||||
if (proj != null) {
|
||||
try {
|
||||
|
@ -282,6 +334,7 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
addr2line = cext[0].getExtensionData("addr2line"); //$NON-NLS-1$;
|
||||
cppfilt = cext[0].getExtensionData("c++filt"); //$NON-NLS-1$;
|
||||
cygpath = cext[0].getExtensionData("cygpath"); //$NON-NLS-1$;
|
||||
nm = cext[0].getExtensionData("nm"); //$NON-NLS-1$;
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
}
|
||||
|
@ -291,10 +344,12 @@ public class CygwinPEBinaryParserPage extends AbstractCOptionPage {
|
|||
addr2line = store.getString(PREF_ADDR2LINE_PATH);
|
||||
cppfilt = store.getString(PREF_CPPFILT_PATH);
|
||||
cygpath = store.getString(PREF_CYGPATH_PATH);
|
||||
nm = store.getString(PREF_NM_PATH);
|
||||
}
|
||||
}
|
||||
fAddr2LineCommandText.setText((addr2line == null || addr2line.length() == 0) ? "addr2line" : addr2line); //$NON-NLS-1$;
|
||||
fCPPFiltCommandText.setText((cppfilt == null || cppfilt.length() == 0) ? "c++filt" : cppfilt); //$NON-NLS-1$;
|
||||
fCygPathCommandText.setText((cygpath == null || cygpath.length() == 0) ? "cygpath" : cygpath); //$NON-NLS-1$;
|
||||
fNMCommandText.setText((nm == null || nm.length() == 0) ? "nm" : nm); //$NON-NLS-1$;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,207 +11,16 @@
|
|||
|
||||
package org.eclipse.cdt.ui.dialogs;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.ICDescriptor;
|
||||
import org.eclipse.cdt.core.ICExtensionReference;
|
||||
import org.eclipse.cdt.internal.ui.CUIMessages;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class MachOBinaryParserPage extends AbstractCOptionPage {
|
||||
public class MachOBinaryParserPage extends AbstractGNUBinaryParserPage {
|
||||
|
||||
public final static String PREF_CPPFILT_PATH = CUIPlugin.PLUGIN_ID + ".cppfilt"; //$NON-NLS-1$
|
||||
|
||||
protected Text fCPPFiltCommandText;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performApply(org.eclipse.core.runtime.IProgressMonitor)
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.ui.dialogs.AbstractGNUBinaryParserPage#getRealBinaryParserPage()
|
||||
*/
|
||||
public void performApply(IProgressMonitor monitor) throws CoreException {
|
||||
if (monitor == null) {
|
||||
monitor = new NullProgressMonitor();
|
||||
}
|
||||
|
||||
String cppfilt = fCPPFiltCommandText.getText().trim();
|
||||
|
||||
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) {
|
||||
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, "BinaryParserPage"); //$NON-NLS-1$
|
||||
IConfigurationElement[] infos = point.getConfigurationElements();
|
||||
for (int i = 0; i < infos.length; i++) {
|
||||
String id = infos[i].getAttribute("parserID"); //$NON-NLS-1$
|
||||
String clazz = infos[i].getAttribute("class"); //$NON-NLS-1$
|
||||
String ego = getRealBinaryParserPage().getClass().getName();
|
||||
if (clazz != null && clazz.equals(ego)) {
|
||||
parserID = id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < cext.length; i++) {
|
||||
if (cext[i].getID().equals(parserID)) {
|
||||
|
||||
String orig = cext[i].getExtensionData("c++filt"); //$NON-NLS-1$
|
||||
if (orig == null || !orig.equals(cppfilt)) {
|
||||
cext[i].setExtensionData("c++filt", cppfilt); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Preferences store = getContainer().getPreferences();
|
||||
if (store != null) {
|
||||
store.setValue(PREF_CPPFILT_PATH, cppfilt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If this class is inherited from then this method MUST be implemented
|
||||
* in the derived class.
|
||||
*/
|
||||
protected Object getRealBinaryParserPage() {
|
||||
protected AbstractGNUBinaryParserPage getRealBinaryParserPage() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults()
|
||||
*/
|
||||
public void performDefaults() {
|
||||
String addr2line = null;
|
||||
String cppfilt = null;
|
||||
IProject proj = getContainer().getProject();
|
||||
Preferences store = getContainer().getPreferences();
|
||||
if (store != null) {
|
||||
if (proj != null) {
|
||||
cppfilt = store.getString(PREF_CPPFILT_PATH);
|
||||
} else {
|
||||
cppfilt = store.getDefaultString(PREF_CPPFILT_PATH);
|
||||
}
|
||||
fCPPFiltCommandText.setText((cppfilt == null || cppfilt.length() == 0) ? "c++filt" : cppfilt); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
public void createControl(Composite parent) {
|
||||
Group comp = new Group(parent, SWT.SHADOW_ETCHED_IN);
|
||||
comp.setText(CUIMessages.getString("BinaryParserBlock.binaryParserOptions")); //$NON-NLS-1$
|
||||
comp.setLayout(new GridLayout(2, true));
|
||||
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
((GridLayout) comp.getLayout()).makeColumnsEqualWidth = false;
|
||||
|
||||
Label label = ControlFactory.createLabel(comp, CUIMessages.getString("BinaryParserPage.label.addr2lineCommand")); //$NON-NLS-1$
|
||||
GridData gd = new GridData();
|
||||
gd.horizontalSpan = 2;
|
||||
label.setLayoutData(gd);
|
||||
|
||||
Button button = ControlFactory.createPushButton(comp, CUIMessages.getString("BinaryParserPage.label.browse")); //$NON-NLS-1$
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected(SelectionEvent evt) {
|
||||
//updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
label = ControlFactory.createLabel(comp, CUIMessages.getString("BinaryParserPage.label.cppfiltCommand")); //$NON-NLS-1$
|
||||
gd = new GridData();
|
||||
gd.horizontalSpan = 2;
|
||||
label.setLayoutData(gd);
|
||||
|
||||
fCPPFiltCommandText = ControlFactory.createTextField(comp, SWT.SINGLE | SWT.BORDER);
|
||||
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();
|
||||
}
|
||||
|
||||
private void handleCPPFiltButtonSelected() {
|
||||
FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
|
||||
dialog.setText(CUIMessages.getString("BinaryParserPage.label.cppfiltCommand")); //$NON-NLS-1$
|
||||
String command = fCPPFiltCommandText.getText().trim();
|
||||
int lastSeparatorIndex = command.lastIndexOf(File.separator);
|
||||
if (lastSeparatorIndex != -1) {
|
||||
dialog.setFilterPath(command.substring(0, lastSeparatorIndex));
|
||||
}
|
||||
String res = dialog.open();
|
||||
if (res == null) {
|
||||
return;
|
||||
}
|
||||
fCPPFiltCommandText.setText(res);
|
||||
}
|
||||
});
|
||||
|
||||
setControl(comp);
|
||||
initialziedValues();
|
||||
}
|
||||
|
||||
private void initialziedValues() {
|
||||
String cppfilt = null;
|
||||
IProject proj = getContainer().getProject();
|
||||
if (proj != null) {
|
||||
try {
|
||||
ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(proj);
|
||||
ICExtensionReference[] cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
if (cext.length > 0) {
|
||||
cppfilt = cext[0].getExtensionData("c++filt"); //$NON-NLS-1$
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
}
|
||||
} else {
|
||||
Preferences store = getContainer().getPreferences();
|
||||
if (store != null) {
|
||||
cppfilt = store.getString(PREF_CPPFILT_PATH);
|
||||
}
|
||||
}
|
||||
fCPPFiltCommandText.setText((cppfilt == null || cppfilt.length() == 0) ? "c++filt" : cppfilt); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue