1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 13:25:45 +02:00

Bug 382462 - Allow debugging without binary parsers enabled

Change-Id: I00cdaa3d9c2f5de279264a337f728b2d6d8ee6ff
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/6356
This commit is contained in:
Marc-Andre Laperle 2012-06-14 20:17:36 -04:00
parent 5a3fe46fd9
commit 8b0d965a24
2 changed files with 15 additions and 7 deletions

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* Copyright (c) 2000, 2012 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -9,6 +9,7 @@
* QNX Software Systems - Initial API and implementation
* Ken Ryall (Nokia) - bugs 118894, 170027, 91771
* Wind River Systems - adapted to work with platform Modules view (bug 210558)
* Marc-Andre Laperle - Bug 382462
*******************************************************************************/
package org.eclipse.cdt.debug.internal.core.model;
@ -97,6 +98,7 @@ import org.eclipse.cdt.debug.internal.core.CSignalManager;
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupParticipant;
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceManager;
import org.eclipse.cdt.utils.Addr64Factory;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IMarkerDelta;
import org.eclipse.core.resources.IProject;
@ -109,8 +111,8 @@ import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
@ -1798,13 +1800,17 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
// And if that doesn't work, use the one from the file.
if (fAddressFactory == null) {
if (getExecFile() != null && getProject() != null) {
IBinaryObject file;
file = getBinaryFile();
IBinaryObject file = getBinaryFile();
if (file != null) {
fAddressFactory = file.getAddressFactory();
}
}
}
// As a last resort, fallback to 64 bit address factory
if (fAddressFactory == null) {
fAddressFactory = new Addr64Factory();
}
}
return fAddressFactory;
}

View file

@ -14,6 +14,7 @@
* Abeer Bagul (Tensilica) - Allow to better override GdbLaunch (bug 339550)
* Anton Gorenkov - Need to use a process factory (Bug 210366)
* Marc Khouzam (Ericsson) - Cleanup the launch if it is cancelled (Bug 374374)
* Marc-Andre Laperle - Bug 382462
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.launching;
@ -277,7 +278,7 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2
}
/**
* Method used to check that the project, program and binary are correct.
* Method used to check that the project and program are correct.
* Can be overridden to avoid checking certain things.
* @since 3.0
*/
@ -286,8 +287,9 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2
ICProject project = verifyCProject(config);
// Now verify we know the program to debug.
IPath exePath = LaunchUtils.verifyProgramPath(config, project);
// Finally, make sure the program is a proper binary.
LaunchUtils.verifyBinary(config, exePath);
// To allow users to debug with binary parsers turned off, we don't call
// LaunchUtils.verifyBinary here. Instead we simply rely on the debugger to
// report any issues with the binary.
return exePath;
}