mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
Replaced tabs with white space.
This commit is contained in:
parent
2d3a869931
commit
5f9445edbd
1 changed files with 74 additions and 74 deletions
|
@ -88,9 +88,9 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
|
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
|
||||||
String program = configuration.getAttribute(PDAPlugin.ATTR_PDA_PROGRAM, (String)null);
|
String program = configuration.getAttribute(PDAPlugin.ATTR_PDA_PROGRAM, (String)null);
|
||||||
if (program == null) {
|
if (program == null) {
|
||||||
abort("Perl program unspecified.", null);
|
abort("Perl program unspecified.", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,19 +103,19 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
|
||||||
launchProcess(launch, program, requestPort, eventPort);
|
launchProcess(launch, program, requestPort, eventPort);
|
||||||
PDALaunch pdaLaunch = (PDALaunch)launch;
|
PDALaunch pdaLaunch = (PDALaunch)launch;
|
||||||
initServices(pdaLaunch, program, requestPort, eventPort);
|
initServices(pdaLaunch, program, requestPort, eventPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launches PDA interpreter with the given program.
|
* Launches PDA interpreter with the given program.
|
||||||
*
|
*
|
||||||
* @param launch Launch that will contain the new process.
|
* @param launch Launch that will contain the new process.
|
||||||
* @param program PDA program to use in the interpreter.
|
* @param program PDA program to use in the interpreter.
|
||||||
* @param requestPort The port number for connecting the request socket.
|
* @param requestPort The port number for connecting the request socket.
|
||||||
* @param eventPort The port number for connecting the events socket.
|
* @param eventPort The port number for connecting the events socket.
|
||||||
*
|
*
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
private void launchProcess(ILaunch launch, String program, int requestPort, int eventPort) throws CoreException {
|
private void launchProcess(ILaunch launch, String program, int requestPort, int eventPort) throws CoreException {
|
||||||
List<String> commandList = new ArrayList<String>();
|
List<String> commandList = new ArrayList<String>();
|
||||||
|
|
||||||
// Find Perl executable
|
// Find Perl executable
|
||||||
|
@ -159,23 +159,23 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
|
||||||
|
|
||||||
// Create a debug platform process object and add it to the launch.
|
// Create a debug platform process object and add it to the launch.
|
||||||
DebugPlugin.newProcess(launch, process, path);
|
DebugPlugin.newProcess(launch, process, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls the launch to initialize DSF services for this launch.
|
* Calls the launch to initialize DSF services for this launch.
|
||||||
*/
|
*/
|
||||||
private void initServices(final PDALaunch pdaLaunch, final String program, final int requestPort, final int eventPort)
|
private void initServices(final PDALaunch pdaLaunch, final String program, final int requestPort, final int eventPort)
|
||||||
throws CoreException
|
throws CoreException
|
||||||
{
|
{
|
||||||
// Synchronization object to use when waiting for the services initialization.
|
// Synchronization object to use when waiting for the services initialization.
|
||||||
Query<Object> initQuery = new Query<Object>() {
|
Query<Object> initQuery = new Query<Object>() {
|
||||||
@Override
|
@Override
|
||||||
protected void execute(DataRequestMonitor<Object> rm) {
|
protected void execute(DataRequestMonitor<Object> rm) {
|
||||||
pdaLaunch.initializeServices(program, requestPort, eventPort, rm);
|
pdaLaunch.initializeServices(program, requestPort, eventPort, rm);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Submit the query to the executor.
|
// Submit the query to the executor.
|
||||||
pdaLaunch.getSession().getExecutor().execute(initQuery);
|
pdaLaunch.getSession().getExecutor().execute(initQuery);
|
||||||
try {
|
try {
|
||||||
// Block waiting for query results.
|
// Block waiting for query results.
|
||||||
|
@ -185,37 +185,37 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
|
||||||
} catch (ExecutionException e1) {
|
} catch (ExecutionException e1) {
|
||||||
throw new DebugException(new Status(IStatus.ERROR, PDAPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in launch sequence", e1.getCause())); //$NON-NLS-1$
|
throw new DebugException(new Status(IStatus.ERROR, PDAPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in launch sequence", e1.getCause())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Throws an exception with a new status containing the given
|
* Throws an exception with a new status containing the given
|
||||||
* message and optional exception.
|
* message and optional exception.
|
||||||
*
|
*
|
||||||
* @param message error message
|
* @param message error message
|
||||||
* @param e underlying exception
|
* @param e underlying exception
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
private void abort(String message, Throwable e) throws CoreException {
|
private void abort(String message, Throwable e) throws CoreException {
|
||||||
throw new CoreException(new Status(IStatus.ERROR, PDAPlugin.PLUGIN_ID, 0, message, e));
|
throw new CoreException(new Status(IStatus.ERROR, PDAPlugin.PLUGIN_ID, 0, message, e));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a free port number on localhost, or -1 if unable to find a free port.
|
* Returns a free port number on localhost, or -1 if unable to find a free port.
|
||||||
*/
|
*/
|
||||||
public static int findFreePort() {
|
public static int findFreePort() {
|
||||||
ServerSocket socket= null;
|
ServerSocket socket= null;
|
||||||
try {
|
try {
|
||||||
socket= new ServerSocket(0);
|
socket= new ServerSocket(0);
|
||||||
return socket.getLocalPort();
|
return socket.getLocalPort();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
} finally {
|
} finally {
|
||||||
if (socket != null) {
|
if (socket != null) {
|
||||||
try {
|
try {
|
||||||
socket.close();
|
socket.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue