mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +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 {
|
try {
|
||||||
remoteShellProcess = new HostShellProcessAdapter(remoteShell) {
|
remoteShellProcess = new HostShellProcessAdapter(remoteShell) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void destroy() {
|
public synchronized void destroy() {
|
||||||
final DsfSession session = l.getSession();
|
final DsfSession session = l.getSession();
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
try {
|
try {
|
||||||
session.getExecutor().execute(new DsfRunnable() {
|
session.getExecutor().execute(new DsfRunnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
DsfServicesTracker tracker = new DsfServicesTracker(
|
DsfServicesTracker tracker = new DsfServicesTracker(
|
||||||
Activator.getBundleContext(),
|
Activator.getBundleContext(),
|
||||||
session.getId());
|
session.getId());
|
||||||
IGDBControl control = tracker
|
IGDBControl control = tracker
|
||||||
.getService(IGDBControl.class);
|
.getService(IGDBControl.class);
|
||||||
if (control != null) {
|
if (control != null) {
|
||||||
control.terminate(new ImmediateRequestMonitor());
|
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();
|
||||||
}
|
}
|
||||||
};
|
RSEHelper.abort(Messages.RemoteRunLaunchDelegate_7, e,
|
||||||
} catch (Exception e) {
|
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
||||||
if (remoteShellProcess != null) {
|
|
||||||
remoteShellProcess.destroy();
|
|
||||||
}
|
}
|
||||||
RSEHelper.abort(Messages.RemoteRunLaunchDelegate_7, e,
|
|
||||||
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
IProcess iProcess = DebugPlugin.newProcess(launch, remoteShellProcess,
|
IProcess iProcess = DebugPlugin.newProcess(launch, remoteShellProcess,
|
||||||
Messages.RemoteRunLaunchDelegate_RemoteShell);
|
Messages.RemoteRunLaunchDelegate_RemoteShell);
|
||||||
|
|
||||||
// Now wait until gdbserver is up and running on the remote host
|
// Now wait until gdbserver is up and running on the remote host
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
|
@ -188,30 +188,30 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Let debugger know how gdbserver was started on the remote
|
// 3. Let debugger know how gdbserver was started on the remote
|
||||||
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
|
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
|
||||||
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP,
|
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP,
|
||||||
true);
|
true);
|
||||||
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_HOST,
|
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_HOST,
|
||||||
RSEHelper.getRemoteHostname(config));
|
RSEHelper.getRemoteHostname(config));
|
||||||
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_PORT,
|
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_PORT,
|
||||||
gdbserverPortNumber);
|
gdbserverPortNumber);
|
||||||
wc.doSave();
|
wc.doSave();
|
||||||
|
|
||||||
}
|
|
||||||
try{
|
|
||||||
super.launch(config, mode, launch, monitor);
|
|
||||||
} catch(CoreException ex) {
|
|
||||||
//launch failed, need to kill gdbserver
|
|
||||||
if (remoteShellProcess != null) {
|
|
||||||
remoteShellProcess.destroy();
|
|
||||||
}
|
}
|
||||||
|
try{
|
||||||
|
super.launch(config, mode, launch, monitor);
|
||||||
|
} catch(CoreException ex) {
|
||||||
|
//launch failed, need to kill gdbserver
|
||||||
|
if (remoteShellProcess != null) {
|
||||||
|
remoteShellProcess.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
//report failure further
|
//report failure further
|
||||||
throw ex;
|
throw ex;
|
||||||
} finally {
|
} finally {
|
||||||
monitor.done();
|
monitor.done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,46 +156,46 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
|
||||||
final Object lock = new Object();
|
final Object lock = new Object();
|
||||||
if (remoteShell != null) {
|
if (remoteShell != null) {
|
||||||
remoteShell
|
remoteShell
|
||||||
.addOutputListener(new IHostShellOutputListener() {
|
.addOutputListener(new IHostShellOutputListener() {
|
||||||
|
|
||||||
public void shellOutputChanged(
|
public void shellOutputChanged(
|
||||||
IHostShellChangeEvent event) {
|
IHostShellChangeEvent event) {
|
||||||
for (IHostOutput line : event
|
for (IHostOutput line : event
|
||||||
.getLines()) {
|
.getLines()) {
|
||||||
if (line.getString().contains(
|
if (line.getString().contains(
|
||||||
"Listening on port")) { //$NON-NLS-1$
|
"Listening on port")) { //$NON-NLS-1$
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
gdbServerReady[0] = true;
|
gdbServerReady[0] = true;
|
||||||
lock.notifyAll();
|
lock.notifyAll();
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
});
|
|
||||||
|
|
||||||
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) {
|
try {
|
||||||
remoteShellProcess.destroy();
|
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
|
IProcess rsProcess = DebugPlugin
|
||||||
.newProcess(
|
.newProcess(
|
||||||
launch,
|
launch,
|
||||||
|
@ -218,62 +218,62 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pre-set configuration constants for the
|
// Pre-set configuration constants for the
|
||||||
// GDBSERVERCDIDebugger to indicate how the gdbserver
|
// GDBSERVERCDIDebugger to indicate how the gdbserver
|
||||||
// was automatically started on the remote.
|
// was automatically started on the remote.
|
||||||
// GDBServerCDIDebugger uses these to figure out how
|
// GDBServerCDIDebugger uses these to figure out how
|
||||||
// to connect to the remote gdbserver.
|
// to connect to the remote gdbserver.
|
||||||
ILaunchConfigurationWorkingCopy wc = config
|
ILaunchConfigurationWorkingCopy wc = config
|
||||||
.getWorkingCopy();
|
.getWorkingCopy();
|
||||||
wc
|
wc
|
||||||
.setAttribute(
|
.setAttribute(
|
||||||
IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP,
|
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);
|
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) {
|
} catch (CoreException e) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -86,22 +86,22 @@ public class ShutdownSequence extends Sequence {
|
||||||
String.format( "(%s=%s)", IDsfService.PROP_SESSION_ID, fSessionId ).intern() ); //$NON-NLS-1$
|
String.format( "(%s=%s)", IDsfService.PROP_SESSION_ID, fSessionId ).intern() ); //$NON-NLS-1$
|
||||||
|
|
||||||
if (serviceRefs != null) {
|
if (serviceRefs != null) {
|
||||||
List<IDsfService> services = new ArrayList<IDsfService>( serviceRefs.length );
|
List<IDsfService> services = new ArrayList<IDsfService>( serviceRefs.length );
|
||||||
for ( ServiceReference<?> ref : serviceRefs ) {
|
for ( ServiceReference<?> ref : serviceRefs ) {
|
||||||
Object serviceObj = GdbPlugin.getBundleContext().getService( ref );
|
Object serviceObj = GdbPlugin.getBundleContext().getService( ref );
|
||||||
if ( serviceObj instanceof IDsfService ) {
|
if ( serviceObj instanceof IDsfService ) {
|
||||||
services.add( (IDsfService)serviceObj );
|
services.add( (IDsfService)serviceObj );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
Collections.sort( services, new Comparator<IDsfService>() {
|
||||||
Collections.sort( services, new Comparator<IDsfService>() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compare( IDsfService o1, IDsfService o2 ) {
|
public int compare( IDsfService o1, IDsfService o2 ) {
|
||||||
return o2.getStartupNumber() - o1.getStartupNumber();
|
return o2.getStartupNumber() - o1.getStartupNumber();
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
result = services.toArray( new IDsfService[services.size()] );
|
result = services.toArray( new IDsfService[services.size()] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( InvalidSyntaxException e ) {
|
catch( InvalidSyntaxException e ) {
|
||||||
// Shouldn't happen
|
// Shouldn't happen
|
||||||
|
|
Loading…
Add table
Reference in a new issue