mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35:40 +02:00
Fix of indentation.
This commit is contained in:
parent
55e8d9f684
commit
1928101334
3 changed files with 157 additions and 157 deletions
|
@ -131,44 +131,44 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
|
|||
}
|
||||
});
|
||||
|
||||
try {
|
||||
remoteShellProcess = new HostShellProcessAdapter(remoteShell) {
|
||||
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());
|
||||
@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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
remoteShellProcess = new HostShellProcessAdapter(remoteShell) {
|
||||
|
||||
@Override
|
||||
public synchronized void destroy() {
|
||||
ICDISession session = getSession();
|
||||
if (session != null) {
|
||||
try {
|
||||
session.terminate();
|
||||
} catch (CDIException e) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.destroy();
|
||||
}
|
||||
};
|
||||
} catch (Exception e) {
|
||||
if (remoteShellProcess != null) {
|
||||
remoteShellProcess.destroy();
|
||||
});
|
||||
|
||||
try {
|
||||
remoteShellProcess = new HostShellProcessAdapter(remoteShell) {
|
||||
|
||||
@Override
|
||||
public synchronized void destroy() {
|
||||
ICDISession session = getSession();
|
||||
if (session != null) {
|
||||
try {
|
||||
session.terminate();
|
||||
} catch (CDIException e) {
|
||||
}
|
||||
}
|
||||
super.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();
|
||||
|
||||
// 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()
|
||||
.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());
|
||||
}
|
||||
CDIDebugModel.newDebugTarget(launch, project
|
||||
.getProject(),
|
||||
targets[i],
|
||||
renderProcessLabel("gdbserver debugger"), //$NON-NLS-1$
|
||||
iprocess, exeFile, true, false, stopSymbol,
|
||||
// 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));
|
||||
|
||||
boolean stopInMain = config
|
||||
.getAttribute(
|
||||
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());
|
||||
}
|
||||
CDIDebugModel.newDebugTarget(launch, project
|
||||
.getProject(),
|
||||
targets[i],
|
||||
renderProcessLabel("gdbserver debugger"), //$NON-NLS-1$
|
||||
iprocess, exeFile, true, false, stopSymbol,
|
||||
true);
|
||||
}
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
try {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue