mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +02:00
Bug 87556: Post-mortem debug fails silently if core file is inaccessible. Applied patch from Joanne Woo (Monta Vista).
This commit is contained in:
parent
d0824d23fd
commit
0467fe740a
4 changed files with 42 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-05-15 Mikhail Khodjaiants
|
||||
Bug 87556: Post-mortem debug fails silently if core file is inaccessible.
|
||||
Applied patch from Joanne Woo (Monta Vista).
|
||||
* CoreFilePrompter.java
|
||||
* CoreFileLaunchDelegate.java
|
||||
* LaunchMessages.properties
|
||||
|
||||
2005-05-18 David Inglis
|
||||
Fixed bug 39581 & part of 46746
|
||||
|
||||
|
|
|
@ -4,10 +4,14 @@
|
|||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors: QNX Software Systems - Initial API and implementation
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
* Monta Vista - Joanne Woo - Bug 87556
|
||||
**************************************************************************************************/
|
||||
package org.eclipse.cdt.launch.internal;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||
|
@ -37,7 +41,6 @@ import org.eclipse.debug.core.model.IProcess;
|
|||
public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
|
||||
|
||||
public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
|
||||
|
||||
if (monitor == null) {
|
||||
monitor = new NullProgressMonitor();
|
||||
}
|
||||
|
@ -63,12 +66,22 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
|
|||
cancel(LaunchMessages.getString("CoreFileLaunchDelegate.No_Corefile_selected"), //$NON-NLS-1$
|
||||
ICDTLaunchConfigurationConstants.ERR_NO_COREFILE);
|
||||
}
|
||||
File file = new File(corefile.toString());
|
||||
if (!file.exists() || !file.canRead()) {
|
||||
cancel(LaunchMessages.getString("CoreFileLaunchDelegate.Corefile_not_readable"), //$NON-NLS-1$
|
||||
ICDTLaunchConfigurationConstants.ERR_NO_COREFILE);
|
||||
}
|
||||
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
|
||||
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, corefile.toString());
|
||||
wc.launch(mode, new SubProgressMonitor(monitor, 9));
|
||||
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, (String)null);
|
||||
cancel("", -1); //$NON-NLS-1$
|
||||
} else {
|
||||
File file = new File(path);
|
||||
if (!file.exists() || !file.canRead()) {
|
||||
abort(LaunchMessages.getString("CoreFileLaunchDelegate.Corefile_not_readable"), null, //$NON-NLS-1$
|
||||
ICDTLaunchConfigurationConstants.ERR_NO_COREFILE);
|
||||
}
|
||||
dsession = debugConfig.createDebugger().createDebuggerSession(launch, exeFile, new SubProgressMonitor(monitor, 8));
|
||||
try {
|
||||
// set the source locator
|
||||
|
|
|
@ -3,10 +3,14 @@
|
|||
* accompanying materials are made available under the terms of the Common Public License v1.0 which
|
||||
* accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors: QNX Software Systems - initial API and implementation
|
||||
* Contributors:
|
||||
* QNX Software Systems - initial API and implementation
|
||||
* Monta Vista - Joanne Woo - Bug 87556
|
||||
**************************************************************************************************/
|
||||
package org.eclipse.cdt.launch.internal.ui;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
||||
import org.eclipse.cdt.debug.core.ICDebugConfiguration;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
@ -18,6 +22,7 @@ import org.eclipse.core.runtime.Status;
|
|||
import org.eclipse.debug.core.IStatusHandler;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.jface.dialogs.ErrorDialog;
|
||||
|
||||
public class CoreFilePrompter implements IStatusHandler {
|
||||
|
||||
|
@ -52,6 +57,14 @@ public class CoreFilePrompter implements IStatusHandler {
|
|||
dialog.setFilterPath(initPath);
|
||||
String res = dialog.open();
|
||||
if (res != null) {
|
||||
File file = new File(res);
|
||||
if (!file.exists() || !file.canRead()) {
|
||||
ErrorDialog.openError(shell, LaunchMessages.getString("CoreFileLaunchDelegate.postmortem_debugging_failed"), //$NON-NLS-1$
|
||||
LaunchMessages.getString("CoreFileLaunchDelegate.Corefile_not_accessible"), //$NON-NLS-1$
|
||||
new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(),
|
||||
ICDTLaunchConfigurationConstants.ERR_NO_COREFILE,
|
||||
LaunchMessages.getString("CoreFileLaunchDelegate.Corefile_not_readable"), null)); //$NON-NLS-1$
|
||||
}
|
||||
return new Path(res);
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#
|
||||
# Contributors:
|
||||
# QNX Software Systems - Initial API and implementation
|
||||
# Monta Vista - Joanne Woo - Bug 87556
|
||||
#######################################################################
|
||||
|
||||
AbstractCLaunchDelegate.Debugger_not_installed=CDT Debugger not installed
|
||||
|
@ -43,6 +44,9 @@ CoreFileLaunchDelegate.Launching_postmortem_debugger=Launching postmortem debugg
|
|||
CoreFileLaunchDelegate.No_Corefile_selected=No Corefile selected
|
||||
CoreFileLaunchDelegate.No_Shell_available_in_Launch=No Shell available in Launch
|
||||
CoreFileLaunchDelegate.Select_Corefile=Select Corefile
|
||||
CoreFileLaunchDelegate.Corefile_not_accessible=Core file is not accessible.
|
||||
CoreFileLaunchDelegate.Corefile_not_readable=Core file does not exist or is not readable.
|
||||
CoreFileLaunchDelegate.postmortem_debugging_failed=Post-mortem debugging failed
|
||||
|
||||
CApplicationLaunchShortcut.Application_Launcher=Application Launcher
|
||||
CApplicationLaunchShortcut.ChooseConfigToDebug=Choose a debug configuration to debug
|
||||
|
|
Loading…
Add table
Reference in a new issue