Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service')
-rw-r--r--dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GDBExtendedControl.java17
-rw-r--r--dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GDBExtendedService.java66
-rw-r--r--dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GdbExtendedDebugServicesFactory.java14
-rw-r--r--dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/IGDBExtendedFunctions.java3
-rw-r--r--dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/command/GdbExtendedCommandFactory_6_8.java14
-rw-r--r--dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/command/commands/CLIGDBVersion.java8
6 files changed, 56 insertions, 66 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GDBExtendedControl.java b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GDBExtendedControl.java
index 9d1c7c1c397..d129d8b9292 100644
--- a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GDBExtendedControl.java
+++ b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GDBExtendedControl.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Marc Khouzam (Ericsson) - initial API and implementation
*******************************************************************************/
@@ -25,25 +25,26 @@ import org.eclipse.debug.core.ILaunchConfiguration;
/**
* 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);
- }
+ public GDBExtendedControl(DsfSession session, ILaunchConfiguration config, CommandFactory factory) {
+ super(session, config, factory);
+ }
- @Override
- protected Sequence getCompleteInitializationSequence(Map<String, Object> attributes, RequestMonitorWithProgress rm) {
+ @Override
+ protected Sequence getCompleteInitializationSequence(Map<String, Object> attributes,
+ RequestMonitorWithProgress rm) {
return new GdbExtendedFinalLaunchSequence(getSession(), attributes, rm);
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GDBExtendedService.java b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GDBExtendedService.java
index fa66f3e7af7..6a2f070a076 100644
--- a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GDBExtendedService.java
+++ b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GDBExtendedService.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Marc Khouzam (Ericsson) - initial API and implementation
*******************************************************************************/
@@ -38,45 +38,43 @@ import org.eclipse.debug.core.IStatusHandler;
import org.osgi.framework.BundleContext;
public class GDBExtendedService extends AbstractDsfService implements IGDBExtendedFunctions {
-
+
private IMICommandControl fCommandControl;
private CommandFactory fCommandFactory;
private CommandCache fVersionCache;
-
- public GDBExtendedService(DsfSession session) {
- super(session);
- }
-
- @Override
- public void initialize(final RequestMonitor rm) {
- super.initialize(new ImmediateRequestMonitor(rm) {
- @Override
- protected void handleSuccess() {
- doInitialize(rm);
+
+ public GDBExtendedService(DsfSession session) {
+ super(session);
+ }
+
+ @Override
+ public void initialize(final RequestMonitor rm) {
+ super.initialize(new ImmediateRequestMonitor(rm) {
+ @Override
+ protected void handleSuccess() {
+ doInitialize(rm);
}
});
}
-
+
private void doInitialize(RequestMonitor rm) {
fCommandControl = getServicesTracker().getService(IMICommandControl.class);
fCommandFactory = fCommandControl.getCommandFactory();
-
+
fVersionCache = new CommandCache(getSession(), fCommandControl);
fVersionCache.setContextAvailable(fCommandControl.getContext(), true);
- register(new String[] { IGDBExtendedFunctions.class.getName() },
- new Hashtable<String, String>());
-
+ register(new String[] { IGDBExtendedFunctions.class.getName() }, new Hashtable<String, String>());
+
rm.done();
}
-
@Override
public void shutdown(RequestMonitor rm) {
unregister();
super.shutdown(rm);
}
-
+
@Override
protected BundleContext getBundleContext() {
return GDBExamplePlugin.getBundleContext();
@@ -84,18 +82,13 @@ public class GDBExtendedService extends AbstractDsfService implements IGDBExtend
@Override
public void notify(ICommandControlDMContext ctx, String str, RequestMonitor rm) {
- IStatus status = new Status(
- IStatus.INFO,
- GdbPlugin.getUniqueIdentifier(),
- IGdbDebugConstants.STATUS_HANDLER_CODE,
- str,
- null);
+ IStatus status = new Status(IStatus.INFO, GdbPlugin.getUniqueIdentifier(),
+ IGdbDebugConstants.STATUS_HANDLER_CODE, str, null);
IStatusHandler statusHandler = DebugPlugin.getDefault().getStatusHandler(status);
if (statusHandler != null) {
try {
statusHandler.handleStatus(status, null);
- }
- catch(CoreException e) {
+ } catch (CoreException e) {
GDBExamplePlugin.getDefault().getLog().log(e.getStatus());
}
}
@@ -105,20 +98,19 @@ public class GDBExtendedService extends AbstractDsfService implements IGDBExtend
@Override
public void getVersion(ICommandControlDMContext ctx, final DataRequestMonitor<String> rm) {
if (fCommandFactory instanceof GdbExtendedCommandFactory_6_8) {
- GdbExtendedCommandFactory_6_8 factory = (GdbExtendedCommandFactory_6_8)fCommandFactory;
+ GdbExtendedCommandFactory_6_8 factory = (GdbExtendedCommandFactory_6_8) fCommandFactory;
// Use the cache to avoid having to go to GDB more than once for a value
// that does not change. No need to even clear the cache since the GDB version will never change.
- fVersionCache.execute(factory.createCLIGDBVersion(ctx),
+ fVersionCache.execute(factory.createCLIGDBVersion(ctx),
new ImmediateDataRequestMonitor<MIGDBVersionInfo>(rm) {
- @Override
- protected void handleSuccess() {
- rm.done(getData().getVersion());
- }
- });
+ @Override
+ protected void handleSuccess() {
+ rm.done(getData().getVersion());
+ }
+ });
} else {
- rm.done(new Status(IStatus.ERROR, GDBExamplePlugin.PLUGIN_ID,
- NOT_SUPPORTED, "Not supported", null)); //$NON-NLS-1$
+ rm.done(new Status(IStatus.ERROR, GDBExamplePlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null)); //$NON-NLS-1$
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GdbExtendedDebugServicesFactory.java b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GdbExtendedDebugServicesFactory.java
index 5a556bb7bdf..111f09908e6 100644
--- a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GdbExtendedDebugServicesFactory.java
+++ b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/GdbExtendedDebugServicesFactory.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Marc Khouzam (Ericsson) - initial API and implementation
*******************************************************************************/
@@ -25,16 +25,16 @@ import org.eclipse.cdt.examples.dsf.gdb.service.command.GdbExtendedCommandFactor
import org.eclipse.debug.core.ILaunchConfiguration;
public class GdbExtendedDebugServicesFactory extends GdbDebugServicesFactory {
-
+
public GdbExtendedDebugServicesFactory(String version, ILaunchConfiguration config) {
super(version, config);
}
-
+
@Override
- @SuppressWarnings("unchecked")
- public <V> V createService(Class<V> clazz, DsfSession session, Object ... optionalArguments) {
+ @SuppressWarnings("unchecked")
+ public <V> V createService(Class<V> clazz, DsfSession session, Object... optionalArguments) {
if (IGDBExtendedFunctions.class.isAssignableFrom(clazz)) {
- return (V)createExtendedService(session);
+ return (V) createExtendedService(session);
}
return super.createService(clazz, session, optionalArguments);
}
@@ -58,7 +58,7 @@ public class GdbExtendedDebugServicesFactory extends GdbDebugServicesFactory {
}
return new GDBControl(session, config, new CommandFactory());
}
-
+
protected IGDBExtendedFunctions createExtendedService(DsfSession session) {
return new GDBExtendedService(session);
}
diff --git a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/IGDBExtendedFunctions.java b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/IGDBExtendedFunctions.java
index 82e086cd1a3..b062fa61dcd 100644
--- a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/IGDBExtendedFunctions.java
+++ b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/IGDBExtendedFunctions.java
@@ -18,13 +18,12 @@ import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
import org.eclipse.cdt.dsf.service.IDsfService;
-
public interface IGDBExtendedFunctions extends IDsfService {
/**
* Request a notification to the user
*/
void notify(ICommandControlDMContext ctx, String str, RequestMonitor rm);
-
+
/**
* Get the version of the debugger
*/
diff --git a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/command/GdbExtendedCommandFactory_6_8.java b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/command/GdbExtendedCommandFactory_6_8.java
index 4c6a28176b0..14dcfb85d4d 100644
--- a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/command/GdbExtendedCommandFactory_6_8.java
+++ b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/command/GdbExtendedCommandFactory_6_8.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Marc Khouzam (Ericsson) - initial API and implementation
*******************************************************************************/
@@ -23,16 +23,14 @@ import org.eclipse.cdt.examples.dsf.gdb.service.command.commands.CLIGDBVersion;
public class GdbExtendedCommandFactory_6_8 extends CommandFactory_6_8 {
@Override
- public ICommand<MIBreakInsertInfo> createMIDPrintfInsert(
- IBreakpointsTargetDMContext ctx, boolean isTemporary,
- String condition, int ignoreCount, int tid, boolean disabled,
- String location, String printfStr) {
+ public ICommand<MIBreakInsertInfo> createMIDPrintfInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
+ String condition, int ignoreCount, int tid, boolean disabled, String location, String printfStr) {
// Prefix all dynamic printf with the [EX] tag
printfStr = printfStr.replaceFirst("^\"", "\"[EX] "); //$NON-NLS-1$ //$NON-NLS-2$
- return super.createMIDPrintfInsert(ctx, isTemporary, condition, ignoreCount,
- tid, disabled, location, printfStr);
+ return super.createMIDPrintfInsert(ctx, isTemporary, condition, ignoreCount, tid, disabled, location,
+ printfStr);
}
-
+
public ICommand<MIGDBVersionInfo> createCLIGDBVersion(ICommandControlDMContext ctx) {
return new CLIGDBVersion(ctx);
}
diff --git a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/command/commands/CLIGDBVersion.java b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/command/commands/CLIGDBVersion.java
index 6d97f4f1bb7..c07e65894cd 100644
--- a/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/command/commands/CLIGDBVersion.java
+++ b/dsf-gdb/org.eclipse.cdt.examples.dsf.gdb/src/org/eclipse/cdt/examples/dsf/gdb/service/command/commands/CLIGDBVersion.java
@@ -23,14 +23,14 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIOutput;
* We use -interpreter-exec console "show version" instead
* of -gdb-version to avoid having the output automatically printed
* to our console.
- *
+ *
*/
public class CLIGDBVersion extends MIInterpreterExecConsole<MIGDBVersionInfo> {
private static final String COMMAND = "show version"; //$NON-NLS-1$
-
+
public CLIGDBVersion(ICommandControlDMContext ctx) {
- super(ctx, COMMAND);
- }
+ super(ctx, COMMAND);
+ }
@Override
public MIInfo getResult(MIOutput out) {

Back to the top