mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bug 486148: Remove support for Apple GDB
The following macos packages were removed: org.eclipse.cdt.dsf.gdb.service.macos, org.eclipse.cdt.dsf.mi.service.command.commands.macos, org.eclipse.cdt.dsf.mi.service.command.output.macos org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.macos The following classes, contained in the above packages are now removed: MacOSCommandFactory.java MacOSGDBProcesses.java MacOSGDBRunControl.java MacOSGdbDebugServicesFactory.java MacOSMIEnvironmentCD.java MacOSMIVarUpdate.java MacOSMIVarUpdateInfo.java MacOSGdbJtagDebugServicesFactory.java The constant LaunchUtils.MACOS_GDB_MARKER was removed. Change-Id: Iea54886a02015dd0b11678a0cd5d911bed129485
This commit is contained in:
parent
9066b061f3
commit
5af6c7413a
15 changed files with 3 additions and 514 deletions
|
@ -62,18 +62,6 @@ public class LaunchUtilsTest {
|
|||
for (String key : versions.keySet()) {
|
||||
assertEquals("From \"" + key + "\"", versions.get(key), LaunchUtils.getGDBVersionFromText(key));
|
||||
}
|
||||
|
||||
versions.clear();
|
||||
versions.put("GNU gdb 6.3.50-20050815 (Apple version gdb-696) (Sat Oct 20 18:20:28 GMT 2007)", "6.3.50"+LaunchUtils.MACOS_GDB_MARKER+"696");
|
||||
versions.put("GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)", "6.3.50"+LaunchUtils.MACOS_GDB_MARKER+"966");
|
||||
versions.put("GNU gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC 2009)", "6.3.50"+LaunchUtils.MACOS_GDB_MARKER+"1346");
|
||||
versions.put("GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar 5 04:43:10 UTC 2010)", "6.3.50"+LaunchUtils.MACOS_GDB_MARKER+"1461.2");
|
||||
versions.put("GNU gdb 7.0 (Apple version gdb-1) (Fri Sep 18 20:40:51 UTC 2009)", "7.0"+LaunchUtils.MACOS_GDB_MARKER+"1");
|
||||
versions.put("GNU gdb 7.0-20050815 (Apple version gdb-01) (Fri Sep 18 20:40:51 UTC 2009)", "7.0"+LaunchUtils.MACOS_GDB_MARKER+"01");
|
||||
|
||||
for (String key : versions.keySet()) {
|
||||
assertEquals("From \"" + key + "\"", versions.get(key), LaunchUtils.getGDBVersionFromText(key));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,13 +36,10 @@ Export-Package: org.eclipse.cdt.dsf.gdb,
|
|||
org.eclipse.cdt.dsf.gdb.service,
|
||||
org.eclipse.cdt.dsf.gdb.service.command,
|
||||
org.eclipse.cdt.dsf.gdb.service.extensions,
|
||||
org.eclipse.cdt.dsf.gdb.service.macos,
|
||||
org.eclipse.cdt.dsf.mi.service,
|
||||
org.eclipse.cdt.dsf.mi.service.breakpoint.actions,
|
||||
org.eclipse.cdt.dsf.mi.service.command,
|
||||
org.eclipse.cdt.dsf.mi.service.command.commands,
|
||||
org.eclipse.cdt.dsf.mi.service.command.commands.macos,
|
||||
org.eclipse.cdt.dsf.mi.service.command.events,
|
||||
org.eclipse.cdt.dsf.mi.service.command.output,
|
||||
org.eclipse.cdt.dsf.mi.service.command.output.macos
|
||||
org.eclipse.cdt.dsf.mi.service.command.output
|
||||
Import-Package: com.ibm.icu.text
|
||||
|
|
|
@ -37,7 +37,6 @@ import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
|
|||
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactoryNS;
|
||||
import org.eclipse.cdt.dsf.gdb.service.SessionType;
|
||||
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl;
|
||||
import org.eclipse.cdt.dsf.gdb.service.macos.MacOSGdbDebugServicesFactory;
|
||||
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
import org.eclipse.cdt.launch.AbstractCLaunchDelegate2;
|
||||
|
@ -457,11 +456,6 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2
|
|||
* @since 4.0
|
||||
*/
|
||||
protected boolean isNonStopSupportedInGdbVersion(String version) {
|
||||
if (version.contains(LaunchUtils.MACOS_GDB_MARKER)) {
|
||||
// Mac OS's GDB does not support Non-Stop
|
||||
return false;
|
||||
}
|
||||
|
||||
if (NON_STOP_FIRST_VERSION.compareTo(version) <= 0) {
|
||||
return true;
|
||||
}
|
||||
|
@ -474,11 +468,6 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2
|
|||
* @since 4.0
|
||||
*/
|
||||
protected boolean isPostMortemTracingSupportedInGdbVersion(String version) {
|
||||
if (version.contains(LaunchUtils.MACOS_GDB_MARKER)) {
|
||||
// Mac OS's GDB does not support post-mortem tracing
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TRACING_FIRST_VERSION.compareTo(version) <= 0
|
||||
// This feature will be available for GDB 7.2. But until that GDB is itself available
|
||||
// there is a pre-release that has a version of 6.8.50.20090414
|
||||
|
@ -498,15 +487,6 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2
|
|||
return new GdbDebugServicesFactoryNS(version);
|
||||
}
|
||||
|
||||
if (version.contains(LaunchUtils.MACOS_GDB_MARKER)) {
|
||||
// The version string at this point should look like
|
||||
// 6.3.50-20050815APPLE1346, we extract the gdb version and apple version
|
||||
String versions [] = version.split(LaunchUtils.MACOS_GDB_MARKER);
|
||||
if (versions.length == 2) {
|
||||
return new MacOSGdbDebugServicesFactory(versions[0], versions[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return new GdbDebugServicesFactory(version);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,11 +65,6 @@ import org.eclipse.debug.core.DebugException;
|
|||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
|
||||
public class LaunchUtils {
|
||||
/**
|
||||
* A prefix that we use to indicate that a GDB version is for MAC OS
|
||||
* @since 3.0
|
||||
*/
|
||||
public static final String MACOS_GDB_MARKER = "APPLE"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Verify the following things about the project:
|
||||
|
@ -269,26 +264,6 @@ public class LaunchUtils {
|
|||
}
|
||||
}
|
||||
|
||||
// Look for the case of Apple's GDB, since the version must be handled differently
|
||||
// The format is:
|
||||
// GNU gdb 6.3.50-20050815 (Apple version gdb-696) (Sat Oct 20 18:20:28 GMT 2007)
|
||||
// GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
|
||||
// GNU gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC 2009)
|
||||
// GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar 5 04:43:10 UTC 2010)
|
||||
// It seems the version that changes is the "Apple version" but we still use both.
|
||||
// The Mac OS prefix and version are appended to the normal version so the
|
||||
// returned string has this format: 6.3.50-20050815APPLE1346. The normal version and the
|
||||
// Apple version are extracted later and passed to the MacOS services factory.
|
||||
if (versionOutput.indexOf("Apple") != -1) { //$NON-NLS-1$
|
||||
// Add a prefix to indicate we are dealing with an Apple GDB
|
||||
version += MACOS_GDB_MARKER;
|
||||
Pattern aPattern = Pattern.compile(" \\(Apple version gdb-(\\d+(\\.\\d+)*)\\)", Pattern.MULTILINE); //$NON-NLS-1$
|
||||
Matcher aMatcher = aPattern.matcher(versionOutput);
|
||||
if (aMatcher.find()) {
|
||||
version += aMatcher.group(1);
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010 Ericsson 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Ericsson - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.gdb.service.macos;
|
||||
|
||||
import org.eclipse.cdt.dsf.debug.service.command.ICommand;
|
||||
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.macos.MacOSMIEnvironmentCD;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.macos.MacOSMIVarUpdate;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIVarUpdateInfo;
|
||||
|
||||
/** @since 3.0 */
|
||||
public class MacOSCommandFactory extends CommandFactory {
|
||||
|
||||
@Override
|
||||
public ICommand<MIInfo> createMIEnvironmentCD(ICommandControlDMContext ctx, String path) {
|
||||
return new MacOSMIEnvironmentCD(ctx, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICommand<MIVarUpdateInfo> createMIVarUpdate(ICommandControlDMContext dmc, String name) {
|
||||
return new MacOSMIVarUpdate(dmc, name);
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010, 2011 Ericsson 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Ericsson - initial API and implementation
|
||||
* Marc-Andre Laperle - fix for bug 269838
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.gdb.service.macos;
|
||||
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.eclipse.cdt.dsf.concurrent.ImmediateRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.cdt.dsf.debug.service.IProcesses;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GDBProcesses;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIProcesses;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIProcesses;
|
||||
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
|
||||
/** @since 3.0 */
|
||||
public class MacOSGDBProcesses extends GDBProcesses {
|
||||
|
||||
public MacOSGDBProcesses(DsfSession session) {
|
||||
super(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(final RequestMonitor requestMonitor) {
|
||||
super.initialize(new ImmediateRequestMonitor(requestMonitor) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
doInitialize(requestMonitor);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void doInitialize(RequestMonitor requestMonitor) {
|
||||
// Register this service.
|
||||
register(new String[] { IProcesses.class.getName(),
|
||||
IMIProcesses.class.getName(),
|
||||
MIProcesses.class.getName(),
|
||||
GDBProcesses.class.getName(),
|
||||
MacOSGDBProcesses.class.getName() },
|
||||
new Hashtable<String, String>());
|
||||
|
||||
getSession().addServiceEventListener(this, null);
|
||||
|
||||
requestMonitor.done();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown(RequestMonitor requestMonitor) {
|
||||
getSession().removeServiceEventListener(this);
|
||||
super.shutdown(requestMonitor);
|
||||
}
|
||||
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatchedMacOS(ISuspendedDMEvent e) {
|
||||
// With Apple-gdb, we flush the command cache because we need
|
||||
// new results from -thread-list-ids
|
||||
// This is because there is no IStartedDMEvent triggered by GDB on Apple-gdb
|
||||
flushCache(null);
|
||||
}
|
||||
}
|
|
@ -1,104 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010, 2011 Wind River 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Marc-Andre Laperle - Mac OS version, fix for bug 265483
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.dsf.gdb.service.macos;
|
||||
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.concurrent.ImmediateRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl;
|
||||
import org.eclipse.cdt.dsf.debug.service.command.ICommand;
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GDBRunControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMICommandControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIRunControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIRunControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
|
||||
/** @since 3.0 */
|
||||
public class MacOSGDBRunControl extends GDBRunControl {
|
||||
|
||||
private CommandFactory fCommandFactory;
|
||||
|
||||
public MacOSGDBRunControl(DsfSession session) {
|
||||
super(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(final RequestMonitor requestMonitor) {
|
||||
super.initialize(new ImmediateRequestMonitor(requestMonitor) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
doInitialize(requestMonitor);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void doInitialize(RequestMonitor requestMonitor) {
|
||||
// Register this service.
|
||||
register(new String[]{ IRunControl.class.getName(),
|
||||
IMIRunControl.class.getName(),
|
||||
MIRunControl.class.getName(),
|
||||
GDBRunControl.class.getName(),
|
||||
MacOSGDBRunControl.class.getName() },
|
||||
new Hashtable<String,String>());
|
||||
|
||||
fCommandFactory = getServicesTracker().getService(IMICommandControl.class).getCommandFactory();
|
||||
|
||||
requestMonitor.done();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown(RequestMonitor requestMonitor) {
|
||||
super.shutdown(requestMonitor);
|
||||
}
|
||||
|
||||
// We use the MIControl code since -exec-interrupt works with Apple gdb
|
||||
// but SIGINT does not; it seems it runs in async mode by default
|
||||
@Override
|
||||
public void suspend(final IExecutionDMContext context, final RequestMonitor rm){
|
||||
assert context != null;
|
||||
|
||||
canSuspend(
|
||||
context,
|
||||
new DataRequestMonitor<Boolean>(getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
if (getData()) {
|
||||
ICommand<MIInfo> cmd = null;
|
||||
if (context instanceof IContainerDMContext) {
|
||||
cmd = fCommandFactory.createMIExecInterrupt(context);
|
||||
} else {
|
||||
IMIExecutionDMContext dmc = DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class);
|
||||
if (dmc == null) {
|
||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, NOT_SUPPORTED, "Given context: " + context + " is not an execution context.", null)); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
rm.done();
|
||||
return;
|
||||
}
|
||||
cmd = fCommandFactory.createMIExecInterrupt(dmc);
|
||||
}
|
||||
getConnection().queueCommand(cmd, new DataRequestMonitor<MIInfo>(getExecutor(), rm));
|
||||
} else {
|
||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Context cannot be suspended.", null)); //$NON-NLS-1$
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010 Ericsson 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Marc-Andre Laperle - Added support for Mac OS (separate factory)
|
||||
* - fix for bug 265483
|
||||
* Ericsson - Added a field for the specific Mac OS version scheme
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.gdb.service.macos;
|
||||
|
||||
import org.eclipse.cdt.dsf.debug.service.IProcesses;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl;
|
||||
import org.eclipse.cdt.dsf.debug.service.command.ICommandControl;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
|
||||
import org.eclipse.cdt.dsf.gdb.service.command.GDBControl;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
|
||||
/** @since 3.0 */
|
||||
public class MacOSGdbDebugServicesFactory extends GdbDebugServicesFactory {
|
||||
|
||||
// Mac OS has it's own version of GDB, which does not follow the standard GDB version
|
||||
// We have to be careful not to compare that specific version number scheme with the
|
||||
// FSF GDB version scheme.
|
||||
// Use this variable when needing to differentiate between different Mac OS GDBs
|
||||
@SuppressWarnings("unused")
|
||||
private final String fAppleVersion;
|
||||
|
||||
public MacOSGdbDebugServicesFactory(String gdbVersion, String appleVersion) {
|
||||
super(gdbVersion);
|
||||
fAppleVersion = appleVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) {
|
||||
return new GDBControl(session, config, new MacOSCommandFactory());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IRunControl createRunControlService(DsfSession session) {
|
||||
return new MacOSGDBRunControl(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IProcesses createProcessesService(DsfSession session) {
|
||||
return new MacOSGDBProcesses(session);
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2006, 2010 Nokia 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Nokia - Initial API and implementation
|
||||
* Marc-Andre Laperle - fix for bug 263689 (spaces in directory)
|
||||
***********************************************************************/
|
||||
package org.eclipse.cdt.dsf.mi.service.command.commands.macos;
|
||||
|
||||
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIEnvironmentCD;
|
||||
|
||||
/**
|
||||
* @since 3.0
|
||||
*/
|
||||
public class MacOSMIEnvironmentCD extends MIEnvironmentCD {
|
||||
|
||||
// We need to send the following format:
|
||||
// -environment-cd "\"/path/without/any/spaces\"" or -environment-cd /path/without/any/spaces
|
||||
// -environment-cd "\"/path/with spaces\""
|
||||
public MacOSMIEnvironmentCD(ICommandControlDMContext ctx, String path) {
|
||||
super(ctx, (path == null) ? null : "\"\\\"" + path + "\\\"\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String parametersToString() {
|
||||
// Apple's GDB is very picky. We override the parameter formatting
|
||||
// so that we can control exactly what will be sent to GDB.
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
for (String parameter : getParameters()) {
|
||||
buffer.append(' ').append(parameter);
|
||||
}
|
||||
return buffer.toString().trim();
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
* Wind River Systems - Modified for new DSF Reference Implementation
|
||||
* Ericsson - Modified for handling of frame contexts
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.dsf.mi.service.command.commands.macos;
|
||||
|
||||
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MIVarUpdate;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIOutput;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIVarUpdateInfo;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.macos.MacOSMIVarUpdateInfo;
|
||||
|
||||
/**
|
||||
*
|
||||
* -var-update [print-values] {NAME | "*"}
|
||||
*
|
||||
* Update the value of the variable object NAME by evaluating its
|
||||
* expression after fetching all the new values from memory or registers.
|
||||
* A `*' causes all existing variable objects to be updated.
|
||||
* If print-values has a value for of 0 or --no-values, print only the names of the variables;
|
||||
* if print-values is 1 or --all-values, also print their values;
|
||||
* if it is 2 or --simple-values print the name and value for simple data types and just
|
||||
* the name for arrays, structures and unions.
|
||||
*
|
||||
* It seems that for MacOS, we must use the full string for print-values, such as
|
||||
* --all-values.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public class MacOSMIVarUpdate extends MIVarUpdate {
|
||||
|
||||
public MacOSMIVarUpdate(ICommandControlDMContext dmc, String name) {
|
||||
super(dmc, name);
|
||||
// Must use --all-values instead of 1 for Mac OS
|
||||
setParameters(new String[] { "--all-values", name }); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public MIVarUpdateInfo getResult(MIOutput out) {
|
||||
return new MacOSMIVarUpdateInfo(out);
|
||||
}
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
* Ericsson - Created version for Mac OS
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.mi.service.command.output.macos;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIList;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIOutput;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIResult;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MITuple;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIValue;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIVarChange;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIVarUpdateInfo;
|
||||
|
||||
/**
|
||||
* GDB/MI var-update for Mac OS.
|
||||
* -var-update *
|
||||
* ^done,changelist=[varobj={name="var1",in_scope="true",type_changed="false"}],time={.....}
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public class MacOSMIVarUpdateInfo extends MIVarUpdateInfo {
|
||||
|
||||
public MacOSMIVarUpdateInfo(MIOutput record) {
|
||||
super(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* For MI2 the format is now a MIList.
|
||||
* @param tuple
|
||||
* @param aList
|
||||
*/
|
||||
@Override
|
||||
protected void parseChangeList(MIList miList, List<MIVarChange> aList) {
|
||||
// The MIList in Apple gdb contains MIResults instead of MIValues. It looks like:
|
||||
// ^done,changelist=[varobj={name="var1",in_scope="true",type_changed="false"}],time={.....}
|
||||
// Bug 250037
|
||||
MIResult[] results = miList.getMIResults();
|
||||
for (int i = 0; i < results.length; i++) {
|
||||
String var = results[i].getVariable();
|
||||
if (var.equals("varobj")) { //$NON-NLS-1$
|
||||
MIValue value = results[i].getMIValue();
|
||||
if (value instanceof MITuple) {
|
||||
parseChangeList((MITuple)value, aList);
|
||||
} else if (value instanceof MIList) {
|
||||
parseChangeList((MIList)value, aList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core;singleton:=true
|
||||
Bundle-Version: 8.5.0.qualifier
|
||||
Bundle-Version: 9.0.0.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.Activator
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
|
@ -18,7 +18,6 @@ Bundle-ActivationPolicy: lazy
|
|||
Export-Package: org.eclipse.cdt.debug.gdbjtag.core,
|
||||
org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service,
|
||||
org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.extensions,
|
||||
org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.macos,
|
||||
org.eclipse.cdt.debug.gdbjtag.core.jtagdevice
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<version>8.5.0-SNAPSHOT</version>
|
||||
<version>9.0.0-SNAPSHOT</version>
|
||||
<artifactId>org.eclipse.cdt.debug.gdbjtag.core</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
|
|
@ -18,7 +18,6 @@ package org.eclipse.cdt.debug.gdbjtag.core;
|
|||
*/
|
||||
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.GdbJtagDebugServicesFactory;
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.macos.MacOSGdbJtagDebugServicesFactory;
|
||||
import org.eclipse.cdt.dsf.concurrent.ThreadSafe;
|
||||
import org.eclipse.cdt.dsf.debug.service.IDsfDebugServicesFactory;
|
||||
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
|
||||
|
@ -46,15 +45,6 @@ public class GDBJtagDSFLaunchConfigurationDelegate extends GdbLaunchDelegate {
|
|||
|
||||
@Override
|
||||
protected IDsfDebugServicesFactory newServiceFactory(ILaunchConfiguration config, String version) {
|
||||
if (version.contains(LaunchUtils.MACOS_GDB_MARKER)) {
|
||||
// The version string at this point should look like
|
||||
// 6.3.50-20050815APPLE1346, we extract the gdb version and apple version
|
||||
String versions [] = version.split(LaunchUtils.MACOS_GDB_MARKER);
|
||||
if (versions.length == 2) {
|
||||
return new MacOSGdbJtagDebugServicesFactory(versions[0], versions[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return new GdbJtagDebugServicesFactory(version);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2011, 2014 Ericsson 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.macos;
|
||||
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.GDBJtagControl;
|
||||
import org.eclipse.cdt.dsf.debug.service.command.ICommandControl;
|
||||
import org.eclipse.cdt.dsf.gdb.service.macos.MacOSCommandFactory;
|
||||
import org.eclipse.cdt.dsf.gdb.service.macos.MacOSGdbDebugServicesFactory;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
|
||||
/** @since 8.4*/
|
||||
public class MacOSGdbJtagDebugServicesFactory extends MacOSGdbDebugServicesFactory {
|
||||
|
||||
public MacOSGdbJtagDebugServicesFactory(String gdbVersion, String appleVersion) {
|
||||
super(gdbVersion, appleVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) {
|
||||
return new GDBJtagControl(session, config, new MacOSCommandFactory());
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue