1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

Bug 121474: NPE in CDebuggerTab.

This commit is contained in:
Mikhail Khodjaiants 2005-12-20 21:15:55 +00:00
parent 4c2b367e01
commit 7b6a596692
2 changed files with 25 additions and 23 deletions

View file

@ -1,3 +1,7 @@
2005-12-20 Mikhail Khodjaiants
Bug 121474: NPE in CDebuggerTab.
* CDebuggerTab.java
2005-09-08 Mikhail Khodjaiants
The "Debugger" tab of the launch configuration dialog is too wide.
* CDebuggerTab.java

View file

@ -28,7 +28,6 @@ import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab;
import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
import org.eclipse.cdt.launch.internal.ui.PixelConverter;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@ -36,13 +35,10 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.internal.ui.SWTUtil;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@ -277,28 +273,30 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String)null);
} catch (CoreException e) {
}
IPath exePath = new Path(programName);
if (projectName != null && !projectName.equals("")) { //$NON-NLS-1$
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
ICExtensionReference[] parserRef = CCorePlugin.getDefault().getBinaryParserExtensions(project);
for (int i = 0; i < parserRef.length; i++) {
try {
IBinaryParser parser = (IBinaryParser)parserRef[i].createExtension();
IBinaryObject exe = (IBinaryObject)parser.getBinary(exePath);
if (exe != null) {
return exe;
if (programName != null ) {
IPath exePath = new Path(programName);
if (projectName != null && !projectName.equals("")) { //$NON-NLS-1$
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
ICExtensionReference[] parserRef = CCorePlugin.getDefault().getBinaryParserExtensions(project);
for (int i = 0; i < parserRef.length; i++) {
try {
IBinaryParser parser = (IBinaryParser)parserRef[i].createExtension();
IBinaryObject exe = (IBinaryObject)parser.getBinary(exePath);
if (exe != null) {
return exe;
}
} catch (ClassCastException e) {
} catch (IOException e) {
}
} catch (ClassCastException e) {
} catch (IOException e) {
}
}
}
IBinaryParser parser = CCorePlugin.getDefault().getDefaultBinaryParser();
try {
IBinaryObject exe = (IBinaryObject)parser.getBinary(exePath);
return exe;
} catch (ClassCastException e) {
} catch (IOException e) {
IBinaryParser parser = CCorePlugin.getDefault().getDefaultBinaryParser();
try {
IBinaryObject exe = (IBinaryObject)parser.getBinary(exePath);
return exe;
} catch (ClassCastException e) {
} catch (IOException e) {
}
}
return null;
}