diff options
3 files changed, 151 insertions, 151 deletions
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java index 04f188d68f0..79b5907a4d3 100644 --- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java +++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java @@ -131,44 +131,44 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate { } }); - try { - remoteShellProcess = new HostShellProcessAdapter(remoteShell) { - - @Override - public synchronized void destroy() { - final DsfSession session = l.getSession(); - if (session != null) { - try { - session.getExecutor().execute(new DsfRunnable() { - public void run() { - DsfServicesTracker tracker = new DsfServicesTracker( - Activator.getBundleContext(), - session.getId()); - IGDBControl control = tracker - .getService(IGDBControl.class); - if (control != null) { - control.terminate(new ImmediateRequestMonitor()); + try { + remoteShellProcess = new HostShellProcessAdapter(remoteShell) { + + @Override + public synchronized void destroy() { + final DsfSession session = l.getSession(); + if (session != null) { + try { + session.getExecutor().execute(new DsfRunnable() { + public void run() { + DsfServicesTracker tracker = new DsfServicesTracker( + Activator.getBundleContext(), + session.getId()); + IGDBControl control = tracker + .getService(IGDBControl.class); + if (control != null) { + control.terminate(new ImmediateRequestMonitor()); + } + tracker.dispose(); } - tracker.dispose(); - } - }); - } catch (RejectedExecutionException e) { - // Session disposed. - } + }); + } catch (RejectedExecutionException e) { + // Session disposed. + } + } + super.destroy(); } - super.destroy(); + }; + } catch (Exception e) { + if (remoteShellProcess != null) { + remoteShellProcess.destroy(); } - }; - } catch (Exception e) { - if (remoteShellProcess != null) { - remoteShellProcess.destroy(); + RSEHelper.abort(Messages.RemoteRunLaunchDelegate_7, e, + ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); } - RSEHelper.abort(Messages.RemoteRunLaunchDelegate_7, e, - ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); - } - IProcess iProcess = DebugPlugin.newProcess(launch, remoteShellProcess, - Messages.RemoteRunLaunchDelegate_RemoteShell); + IProcess iProcess = DebugPlugin.newProcess(launch, remoteShellProcess, + Messages.RemoteRunLaunchDelegate_RemoteShell); // Now wait until gdbserver is up and running on the remote host synchronized (lock) { @@ -188,30 +188,30 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate { } } - // 3. Let debugger know how gdbserver was started on the remote - ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); - wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, - true); - wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_HOST, - RSEHelper.getRemoteHostname(config)); - wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_PORT, - gdbserverPortNumber); - wc.doSave(); + // 3. Let debugger know how gdbserver was started on the remote + ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); + wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, + true); + wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_HOST, + RSEHelper.getRemoteHostname(config)); + wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_PORT, + gdbserverPortNumber); + wc.doSave(); - } - try{ - super.launch(config, mode, launch, monitor); - } catch(CoreException ex) { - //launch failed, need to kill gdbserver - if (remoteShellProcess != null) { - remoteShellProcess.destroy(); } - - //report failure further - throw ex; - } finally { - monitor.done(); - } + try{ + super.launch(config, mode, launch, monitor); + } catch(CoreException ex) { + //launch failed, need to kill gdbserver + if (remoteShellProcess != null) { + remoteShellProcess.destroy(); + } + + //report failure further + throw ex; + } finally { + monitor.done(); + } } } diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteRunLaunchDelegate.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteRunLaunchDelegate.java index cff7acee2a5..e0b26e7c923 100644 --- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteRunLaunchDelegate.java +++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteRunLaunchDelegate.java @@ -156,46 +156,46 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate { final Object lock = new Object(); if (remoteShell != null) { remoteShell - .addOutputListener(new IHostShellOutputListener() { + .addOutputListener(new IHostShellOutputListener() { - public void shellOutputChanged( - IHostShellChangeEvent event) { - for (IHostOutput line : event - .getLines()) { - if (line.getString().contains( - "Listening on port")) { //$NON-NLS-1$ - synchronized (lock) { - gdbServerReady[0] = true; - lock.notifyAll(); - } - break; - } + public void shellOutputChanged( + IHostShellChangeEvent event) { + for (IHostOutput line : event + .getLines()) { + if (line.getString().contains( + "Listening on port")) { //$NON-NLS-1$ + synchronized (lock) { + gdbServerReady[0] = true; + lock.notifyAll(); } + break; } - }); + } + } + }); - try { - remoteShellProcess = new HostShellProcessAdapter(remoteShell) { + try { + remoteShellProcess = new HostShellProcessAdapter(remoteShell) { - @Override - public synchronized void destroy() { - ICDISession session = getSession(); - if (session != null) { - try { - session.terminate(); - } catch (CDIException e) { + @Override + public synchronized void destroy() { + ICDISession session = getSession(); + if (session != null) { + try { + session.terminate(); + } catch (CDIException e) { + } } + super.destroy(); } - super.destroy(); + }; + } catch (Exception e) { + if (remoteShellProcess != null) { + remoteShellProcess.destroy(); } - }; - } catch (Exception e) { - if (remoteShellProcess != null) { - remoteShellProcess.destroy(); + RSEHelper.abort(Messages.RemoteRunLaunchDelegate_7, e, + ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); } - RSEHelper.abort(Messages.RemoteRunLaunchDelegate_7, e, - ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); - } IProcess rsProcess = DebugPlugin .newProcess( launch, @@ -218,62 +218,62 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate { } } - // Pre-set configuration constants for the - // GDBSERVERCDIDebugger to indicate how the gdbserver - // was automatically started on the remote. - // GDBServerCDIDebugger uses these to figure out how - // to connect to the remote gdbserver. - ILaunchConfigurationWorkingCopy wc = config - .getWorkingCopy(); - wc - .setAttribute( - IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, - true); - wc - .setAttribute( - IGDBServerMILaunchConfigurationConstants.ATTR_HOST, - RSEHelper.getRemoteHostname(config)); - wc - .setAttribute( - IGDBServerMILaunchConfigurationConstants.ATTR_PORT, - gdbserver_port_number); - wc.doSave(); + // Pre-set configuration constants for the + // GDBSERVERCDIDebugger to indicate how the gdbserver + // was automatically started on the remote. + // GDBServerCDIDebugger uses these to figure out how + // to connect to the remote gdbserver. + ILaunchConfigurationWorkingCopy wc = config + .getWorkingCopy(); + wc + .setAttribute( + IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, + true); + wc + .setAttribute( + IGDBServerMILaunchConfigurationConstants.ATTR_HOST, + RSEHelper.getRemoteHostname(config)); + wc + .setAttribute( + IGDBServerMILaunchConfigurationConstants.ATTR_PORT, + gdbserver_port_number); + wc.doSave(); - // Default to using the GDBServerCDIDebugger. - GDBServerCDIDebugger2 debugger = new GDBServerCDIDebugger2(); - dsession = ((ICDIDebugger2) debugger).createSession( - launch, exePath.toFile(), - new SubProgressMonitor(monitor, 15)); + // Default to using the GDBServerCDIDebugger. + GDBServerCDIDebugger2 debugger = new GDBServerCDIDebugger2(); + dsession = ((ICDIDebugger2) debugger).createSession( + launch, exePath.toFile(), + new SubProgressMonitor(monitor, 15)); - boolean stopInMain = config - .getAttribute( - ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, - false); - String stopSymbol = null; - if (stopInMain) - stopSymbol = launch - .getLaunchConfiguration() + boolean stopInMain = config .getAttribute( - ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, - ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT); + ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, + false); + String stopSymbol = null; + if (stopInMain) + stopSymbol = launch + .getLaunchConfiguration() + .getAttribute( + ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, + ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT); - ICDITarget[] targets = dsession.getTargets(); - for (int i = 0; i < targets.length; i++) { - Process process = targets[i].getProcess(); - IProcess iprocess = null; - if (process != null) { - iprocess = DebugPlugin.newProcess(launch, - process, renderProcessLabel(exePath - .toOSString()), - getDefaultProcessMap()); + ICDITarget[] targets = dsession.getTargets(); + for (int i = 0; i < targets.length; i++) { + Process process = targets[i].getProcess(); + IProcess iprocess = null; + if (process != null) { + iprocess = DebugPlugin.newProcess(launch, + process, renderProcessLabel(exePath + .toOSString()), + getDefaultProcessMap()); + } + CDIDebugModel.newDebugTarget(launch, project + .getProject(), + targets[i], + renderProcessLabel("gdbserver debugger"), //$NON-NLS-1$ + iprocess, exeFile, true, false, stopSymbol, + true); } - CDIDebugModel.newDebugTarget(launch, project - .getProject(), - targets[i], - renderProcessLabel("gdbserver debugger"), //$NON-NLS-1$ - iprocess, exeFile, true, false, stopSymbol, - true); - } } } catch (CoreException e) { try { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java index d718f564755..b9cd1e30abb 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/ShutdownSequence.java @@ -86,22 +86,22 @@ public class ShutdownSequence extends Sequence { String.format( "(%s=%s)", IDsfService.PROP_SESSION_ID, fSessionId ).intern() ); //$NON-NLS-1$ if (serviceRefs != null) { - List<IDsfService> services = new ArrayList<IDsfService>( serviceRefs.length ); - for ( ServiceReference<?> ref : serviceRefs ) { - Object serviceObj = GdbPlugin.getBundleContext().getService( ref ); - if ( serviceObj instanceof IDsfService ) { - services.add( (IDsfService)serviceObj ); + List<IDsfService> services = new ArrayList<IDsfService>( serviceRefs.length ); + for ( ServiceReference<?> ref : serviceRefs ) { + Object serviceObj = GdbPlugin.getBundleContext().getService( ref ); + if ( serviceObj instanceof IDsfService ) { + services.add( (IDsfService)serviceObj ); + } } - } - Collections.sort( services, new Comparator<IDsfService>() { + Collections.sort( services, new Comparator<IDsfService>() { - @Override - public int compare( IDsfService o1, IDsfService o2 ) { - return o2.getStartupNumber() - o1.getStartupNumber(); - } - } ); - result = services.toArray( new IDsfService[services.size()] ); - } + @Override + public int compare( IDsfService o1, IDsfService o2 ) { + return o2.getStartupNumber() - o1.getStartupNumber(); + } + } ); + result = services.toArray( new IDsfService[services.size()] ); + } } catch( InvalidSyntaxException e ) { // Shouldn't happen |