Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorbjörn SVENSSON2018-12-05 07:43:21 -0500
committerJonah Graham2018-12-06 05:11:54 -0500
commit4c605d68c5e8af4a1e948956f6be118a86a4c865 (patch)
treea24882c7a5da0d63f711f434d8e29460c8838433 /dsf-gdb
parent089d7e1d6124620ff8900acfb238dcb40b7bd795 (diff)
downloadorg.eclipse.cdt-4c605d68c5e8af4a1e948956f6be118a86a4c865.tar.gz
org.eclipse.cdt-4c605d68c5e8af4a1e948956f6be118a86a4c865.tar.xz
org.eclipse.cdt-4c605d68c5e8af4a1e948956f6be118a86a4c865.zip
Bug 542436 - Added method to override whitch IGDBBackend instance to control
In some situations, it makes sense to have more than one GDB instance. Allow to reuse the GDB controling layer to avoid more code duplication than neccessary to have a second GDB session. Change-Id: I641919157c5b86c14ff768c8cd3fcddc9dcdbeb2 Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java
index 0424ae5ad7..c456c372d1 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java
@@ -20,6 +20,7 @@
* if it is still running (bug 373845)
* Marc Khouzam (Ericsson) - Terminate the session if we lose the connection to the remote target (bug 422586)
* Marc Khouzam (Ericsson) - Allow to override the creation of the ControlDMC (Bug 389945)
+ * STMicroelectronics - Allow to override the IGDBBackend instance to use (Bug 542436)
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.service.command;
@@ -241,6 +242,15 @@ public class GDBControl extends AbstractMIControl implements IGDBControl {
return GdbPlugin.getBundleContext();
}
+ /**
+ * Return the GDB back end this GDB control shall manage.
+ * @return The IGDBBackend instance
+ * @since 5.6
+ */
+ protected IGDBBackend getGDBBackend() {
+ return getServicesTracker().getService(IGDBBackend.class);
+ }
+
@Override
public void initialize(final RequestMonitor requestMonitor) {
super.initialize(new ImmediateRequestMonitor(requestMonitor) {
@@ -253,7 +263,7 @@ public class GDBControl extends AbstractMIControl implements IGDBControl {
private void doInitialize(final RequestMonitor requestMonitor) {
- fMIBackend = getServicesTracker().getService(IGDBBackend.class);
+ fMIBackend = getGDBBackend();
// getId, called to create this context, uses the MIBackend service,
// which is why we must wait until we have MIBackend, before we can create the below context.

Back to the top