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

Bug 469763 - DSF-GDB top-level service classes for better extensibility

Change-Id: Ie01af2df69a4c12bc3489ab5ecb76a3f5b6bfa79
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Marc Khouzam 2015-07-22 10:06:24 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent 7168d36c58
commit 0d7432318e
28 changed files with 1008 additions and 26 deletions

View file

@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb;singleton:=true
Bundle-Version: 4.7.0.qualifier
Bundle-Version: 4.8.0.qualifier
Bundle-Activator: org.eclipse.cdt.dsf.gdb.internal.GdbPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
@ -35,6 +35,7 @@ Export-Package: org.eclipse.cdt.dsf.gdb,
org.eclipse.cdt.dsf.gdb.launching,
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,

View file

@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
<version>4.7.0-SNAPSHOT</version>
<version>4.8.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.dsf.gdb</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View file

@ -26,6 +26,7 @@ import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.dsf.debug.service.AbstractDsfDebugServicesFactory;
import org.eclipse.cdt.dsf.debug.service.IBreakpoints;
import org.eclipse.cdt.dsf.debug.service.IDisassembly;
import org.eclipse.cdt.dsf.debug.service.IDsfDebugServicesFactory;
import org.eclipse.cdt.dsf.debug.service.IExpressions;
import org.eclipse.cdt.dsf.debug.service.IMemory;
import org.eclipse.cdt.dsf.debug.service.IModules;
@ -35,6 +36,8 @@ import org.eclipse.cdt.dsf.debug.service.IRunControl;
import org.eclipse.cdt.dsf.debug.service.ISourceLookup;
import org.eclipse.cdt.dsf.debug.service.IStack;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControl;
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
import org.eclipse.cdt.dsf.gdb.service.command.CommandFactory_6_8;
import org.eclipse.cdt.dsf.gdb.service.command.GDBControl;
import org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_0;
@ -53,7 +56,12 @@ import org.eclipse.cdt.dsf.mi.service.MIModules;
import org.eclipse.cdt.dsf.mi.service.MIStack;
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.cdt.dsf.service.IDsfService;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.osgi.util.NLS;
public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory {
@ -77,9 +85,8 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory {
public static final String GDB_7_6_VERSION = "7.5.50"; //$NON-NLS-1$
/** @since 4.4 */
public static final String GDB_7_7_VERSION = "7.7"; //$NON-NLS-1$
/** @since 4.7 */
// TODO: replace with version 7.10, when released
private static final String GDB_7_10_VERSION = "7.9.50.20150402"; //$NON-NLS-1$
/** @since 4.8 */
public static final String GDB_7_10_VERSION = "7.10"; //$NON-NLS-1$
private final String fVersion;
@ -302,4 +309,37 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory {
protected MIBreakpointsSynchronizer createBreakpointsSynchronizerService(DsfSession session) {
return new MIBreakpointsSynchronizer(session);
}
/**
* A static method that will compare the version of GDB for the specified session and
* the minimum GDB version required by the caller. A warning will be logged if the
* running version is not sufficient.
*
* @param session The debug session running GDB
* @param minVersion The minimum version of GDB required
* @param service The service requesting the check.
*
* @since 4.8
*/
public static void validateGdbVersion(DsfSession session, String minVersion, IDsfService service) {
ILaunch launch = (ILaunch)session.getModelAdapter(ILaunch.class);
if (launch instanceof GdbLaunch) {
IDsfDebugServicesFactory servicesFactory = ((GdbLaunch)launch).getServiceFactory();
if (servicesFactory instanceof GdbDebugServicesFactory) {
String version = ((GdbDebugServicesFactory)servicesFactory).getVersion();
if (minVersion.compareTo(version) > 0) {
assert false;
GdbPlugin.log(
new Status(
IStatus.WARNING, GdbPlugin.PLUGIN_ID,
NLS.bind(
Messages.GDB_Version_Mismatch,
new Object[] { version, service.getClass().getName(), minVersion })));
}
return;
}
}
assert false;
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2014 Ericsson and others.
* Copyright (c) 2012, 2015 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
@ -29,6 +29,7 @@ class Messages extends NLS {
public static String RegisterGroup_name_reserved;
public static String RegisterGroup_name_used;
public static String RegisterGroup_invalid_number_of_registers;
public static String GDB_Version_Mismatch;
static {
// initialize resource bundle

View file

@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2012, 2014 Ericsson and others.
# Copyright (c) 2012, 2015 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
@ -21,3 +21,4 @@ ErrorNotSupported=Operation not supported with this GDB version
RegisterGroup_name_reserved=The group name "{0}" is reserved
RegisterGroup_name_used=The group name "{0}" is already in use
RegisterGroup_invalid_number_of_registers=A minimum of one register is needed for a Register Group
GDB_Version_Mismatch=Running older GDB version {0} when service {1} expects version {2} or higher

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.gdb.service.GDBBackend;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.mi.service.IMIBackend;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.debug.core.ILaunchConfiguration;
/**
* Top-level class in the version hierarchy of implementations of {@link IMIBackend}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBBackend_HEAD extends GDBBackend {
public GDBBackend_HEAD(DsfSession session, ILaunchConfiguration lc) {
super(session, lc);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_1_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.gdb.service.GDBBreakpointsManager_7_2;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link MIBreakpointsManager}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBBreakpointsManager_HEAD extends GDBBreakpointsManager_7_2 {
public GDBBreakpointsManager_HEAD(DsfSession session, String debugModelId) {
super(session, debugModelId);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_2_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,50 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.mi.service.MIBreakpointsSynchronizer;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link MIBreakpointsSynchronizer}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBBreakpointsSynchronizer_HEAD extends MIBreakpointsSynchronizer {
public GDBBreakpointsSynchronizer_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_1_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.IBreakpoints;
import org.eclipse.cdt.dsf.gdb.service.GDBBreakpoints_7_7;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IBreakpoints}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBBreakpoints_HEAD extends GDBBreakpoints_7_7 {
public GDBBreakpoints_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_7_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,53 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_7;
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.debug.core.ILaunchConfiguration;
/**
* Top-level class in the version hierarchy of implementations of {@link ICommandControlService}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBControl_HEAD extends GDBControl_7_7 {
public GDBControl_HEAD(DsfSession session, ILaunchConfiguration lc, CommandFactory factory) {
super(session, lc, factory);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_7_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.IDisassembly;
import org.eclipse.cdt.dsf.gdb.service.GDBDisassembly_7_3;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IDisassembly}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBDisassembly_HEAD extends GDBDisassembly_7_3 {
public GDBDisassembly_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_3_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.IExpressions;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.mi.service.MIExpressions;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IExpressions}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBExpressions_HEAD extends MIExpressions {
public GDBExpressions_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_1_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.gdb.service.GDBHardwareAndOS_7_10;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.gdb.service.IGDBHardwareAndOS;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IGDBHardwareAndOS}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBHardwareAndOS_HEAD extends GDBHardwareAndOS_7_10 {
public GDBHardwareAndOS_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_10_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.IMemory;
import org.eclipse.cdt.dsf.gdb.service.GDBMemory_7_6;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IMemory}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBMemory_HEAD extends GDBMemory_7_6 {
public GDBMemory_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_6_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.IModules;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.mi.service.MIModules;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IModules}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBModules_HEAD extends MIModules {
public GDBModules_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_1_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.IProcesses;
import org.eclipse.cdt.dsf.gdb.service.GDBProcesses_7_4;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IProcesses}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBProcesses_HEAD extends GDBProcesses_7_4 {
public GDBProcesses_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_4_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.IRegisters;
import org.eclipse.cdt.dsf.gdb.service.GDBRegisters;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IRegisters}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBRegisters_HEAD extends GDBRegisters {
public GDBRegisters_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_1_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,52 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.IRunControl;
import org.eclipse.cdt.dsf.gdb.service.GDBRunControl_7_6;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IRunControl}
* in All-Stop.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBRunControl_HEAD extends GDBRunControl_7_6 {
public GDBRunControl_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_6_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,52 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.IRunControl;
import org.eclipse.cdt.dsf.gdb.service.GDBRunControl_7_2_NS;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IRunControl}
* in Non-Stop.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBRunControl_NS_HEAD extends GDBRunControl_7_2_NS {
public GDBRunControl_NS_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_2_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.ISourceLookup;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.mi.service.CSourceLookup;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link ISourceLookup}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBSourceLookup_HEAD extends CSourceLookup {
public GDBSourceLookup_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_1_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.debug.service.IStack;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.mi.service.MIStack;
import org.eclipse.cdt.dsf.service.DsfSession;
/**
* Top-level class in the version hierarchy of implementations of {@link IStack}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBStack_HEAD extends MIStack {
public GDBStack_HEAD(DsfSession session) {
super(session);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_1_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -0,0 +1,52 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.extensions;
import org.eclipse.cdt.dsf.gdb.service.GDBTraceControl_7_4;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.debug.core.ILaunchConfiguration;
/**
* Top-level class in the version hierarchy of implementations of {@link IGDBTraceControl}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 4.8
*/
public class GDBTraceControl_HEAD extends GDBTraceControl_7_4 {
public GDBTraceControl_HEAD(DsfSession session, ILaunchConfiguration lc) {
super(session, lc);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_4_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014 Ericsson and others.
* Copyright (c) 2014, 2015 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
@ -29,12 +29,12 @@ import org.eclipse.cdt.examples.dsf.gdb.service.IGDBExtendedFunctions;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
public class GdbExtendedFinalLaunchSequence_7_7 extends FinalLaunchSequence_7_7 {
public class GdbExtendedFinalLaunchSequence extends FinalLaunchSequence_7_7 {
private IGDBControl fControl;
private DsfServicesTracker fTracker;
public GdbExtendedFinalLaunchSequence_7_7(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) {
public GdbExtendedFinalLaunchSequence(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) {
super(session, attributes, rm);
}
@ -46,10 +46,10 @@ public class GdbExtendedFinalLaunchSequence_7_7 extends FinalLaunchSequence_7_7
List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL)));
// Now insert our init step right after the initialization of the base class.
orderList.add(orderList.indexOf("stepInitializeFinalLaunchSequence_7_7") + 1, "stepInitializeExtendedFinalLaunchSequence_7_7"); //$NON-NLS-1$ //$NON-NLS-2$
orderList.add(orderList.indexOf("stepInitializeFinalLaunchSequence_7_7") + 1, "stepInitializeExtendedFinalLaunchSequence"); //$NON-NLS-1$ //$NON-NLS-2$
// As the first operation to do, show the user the version of GDB
orderList.add(orderList.indexOf("stepInitializeExtendedFinalLaunchSequence_7_7") + 1, "stepNotifyVersion"); //$NON-NLS-1$ //$NON-NLS-2$
orderList.add(orderList.indexOf("stepInitializeExtendedFinalLaunchSequence") + 1, "stepNotifyVersion"); //$NON-NLS-1$ //$NON-NLS-2$
// Add the step to set pagination before the .gdbinit file is sourced
// that way the user can override this setting using .gdbinit.
@ -62,7 +62,7 @@ public class GdbExtendedFinalLaunchSequence_7_7 extends FinalLaunchSequence_7_7
}
@Execute
public void stepInitializeExtendedFinalLaunchSequence_7_7(RequestMonitor rm) {
public void stepInitializeExtendedFinalLaunchSequence(RequestMonitor rm) {
fTracker = new DsfServicesTracker(GDBExamplePlugin.getBundleContext(), getSession().getId());
fControl = fTracker.getService(IGDBControl.class);
@ -74,8 +74,8 @@ public class GdbExtendedFinalLaunchSequence_7_7 extends FinalLaunchSequence_7_7
rm.done();
}
@RollBack("stepInitializeExtendedFinalLaunchSequence_7_7")
public void rollBackInitializeExtendedFinalLaunchSequence_7_7(RequestMonitor rm) {
@RollBack("stepInitializeExtendedFinalLaunchSequence")
public void rollBackInitializeExtendedFinalLaunchSequence(RequestMonitor rm) {
if (fTracker != null) fTracker.dispose();
fTracker = null;
rm.done();
@ -116,7 +116,7 @@ public class GdbExtendedFinalLaunchSequence_7_7 extends FinalLaunchSequence_7_7
}
@Execute
public void stepCleanupExtendedFinalLaunchSequence_7_7(final RequestMonitor rm) {
public void stepCleanupExtendedFinalLaunchSequence(final RequestMonitor rm) {
if (fTracker != null) fTracker.dispose();
fTracker = null;
rm.done();

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014 Ericsson and others.
* Copyright (c) 2014, 2015 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
@ -14,19 +14,33 @@ import java.util.Map;
import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress;
import org.eclipse.cdt.dsf.concurrent.Sequence;
import org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_7;
import org.eclipse.cdt.dsf.gdb.service.extensions.GDBControl_HEAD;
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.cdt.examples.dsf.gdb.launch.GdbExtendedFinalLaunchSequence_7_7;
import org.eclipse.cdt.examples.dsf.gdb.launch.GdbExtendedFinalLaunchSequence;
import org.eclipse.debug.core.ILaunchConfiguration;
public class GDBExtendedControl_7_7 extends GDBControl_7_7 {
public GDBExtendedControl_7_7(DsfSession session, ILaunchConfiguration config, CommandFactory factory) {
/**
* Class that extends GDBControl.
*
* Note that by extending the GDBControl_HEAD class, we will always extend
* the latest version of the GDBControl service. The downside of this is
* that we will automatically bring in the latest version of the service
* even for the older GDB version that originally used GDBExtendedControl.
* This is because of how GDBExtendedControl is instantiated in
* GdbExtendedDebugServicesFactory.
*
* As we want to focus on the latest version of GDB, this is still the simplest
* solution to use.
*
*/
public class GDBExtendedControl extends GDBControl_HEAD {
public GDBExtendedControl(DsfSession session, ILaunchConfiguration config, CommandFactory factory) {
super(session, config, factory);
}
@Override
protected Sequence getCompleteInitializationSequence(Map<String, Object> attributes, RequestMonitorWithProgress rm) {
return new GdbExtendedFinalLaunchSequence_7_7(getSession(), attributes, rm);
return new GdbExtendedFinalLaunchSequence(getSession(), attributes, rm);
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014 Ericsson and others.
* Copyright (c) 2014, 2015 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
@ -39,7 +39,7 @@ public class GdbExtendedDebugServicesFactory extends GdbDebugServicesFactory {
@Override
protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) {
if (GDB_7_7_VERSION.compareTo(getVersion()) <= 0) {
return new GDBExtendedControl_7_7(session, config, new GdbExtendedCommandFactory_6_8());
return new GDBExtendedControl(session, config, new GdbExtendedCommandFactory_6_8());
}
if (GDB_7_4_VERSION.compareTo(getVersion()) <= 0) {
return new GDBControl_7_4(session, config, new GdbExtendedCommandFactory_6_8());

View file

@ -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.4.0.qualifier
Bundle-Version: 8.5.0.qualifier
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
@ -17,6 +17,7 @@ Require-Bundle: org.eclipse.core.runtime,
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

View file

@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
<version>8.4.0-SNAPSHOT</version>
<version>8.5.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.debug.gdbjtag.core</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View file

@ -0,0 +1,53 @@
/*******************************************************************************
* Copyright (c) 2015 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
*******************************************************************************/
package org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.extensions;
import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.GDBJtagControl_7_7;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.debug.core.ILaunchConfiguration;
/**
* Top-level class in the version hierarchy of the JTag implementations of {@link ICommandControlService}.
* <br>
* Extenders should subclass this class for their special needs, which will allow
* them to always extend the most recent version of the service.
* For example, if GDB<Service>_7_9 is added, this GDB<Service>_HEAD class
* will be changed to extend it instead of the previous version, therefore
* automatically allowing extenders to be extending the new class.
*
* NOTE: Older versions of GDB that were already using an extending class,
* will automatically start using the new service version, which may
* not be desirable. Extenders should update how they extend
* GdbDebugServicesFactory to properly choose the version of the
* service that should be used for older GDBs.
*
* On the contrary, not using GDB<Service>_HEAD requires the
* extender to update how they extend GdbDebugServicesFactory
* whenever a new GDB<Service> version is added.
*
* Extenders that prefer to focus on the latest GDB version are
* encouraged to extend GDB<Service>_HEAD.
*
* @since 8.5
*/
public class GDBJtagControl_HEAD extends GDBJtagControl_7_7 {
public GDBJtagControl_HEAD(DsfSession session, ILaunchConfiguration config, CommandFactory factory) {
super(session, config, factory);
validateGdbVersion(session);
}
protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_7_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
}
}