Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsgibly2007-05-24 11:41:21 +0000
committersgibly2007-05-24 11:41:21 +0000
commit15cb7682968d0b341e211fe9336acc3040ec629c (patch)
tree7ad53335d174c86997165b1cee830f13153b877f
parente38db8b0c1e39e3dee9104706e5a4c8162559808 (diff)
downloadorg.eclipse.pdt-15cb7682968d0b341e211fe9336acc3040ec629c.tar.gz
org.eclipse.pdt-15cb7682968d0b341e211fe9336acc3040ec629c.tar.xz
org.eclipse.pdt-15cb7682968d0b341e211fe9336acc3040ec629c.zip
Make sure that the communication daemons are alive and listening by calling a validation method when triggering the debug/run actions.
(fixed bug #174950)
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.properties2
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/communication/DebugConnectionThread.java2
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/communication/DebuggerCommunicationDaemon.java18
3 files changed, 18 insertions, 4 deletions
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.properties b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.properties
index 4a325a4a7..24873dbd4 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.properties
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/PHPDebugCoreMessages.properties
@@ -35,4 +35,4 @@ PHPLaunchUtilities_rememberDecision=&Remember my decision
PHPLaunchUtilities_PHPPerspectiveSwitchTitle=Confirm Open Perspective
PHPLaunchUtilities_PHPPerspectiveSwitchMessage=The debug session was terminated. Do you wish to switch back to the {0} perspective?
Port_Error_Message_Title=PHP Debugger Port Problem
-Port_Error_Message_Message=The port you requested {0} is already in use.\nPlease select a different port in the PHP debug preferences.
+Port_Error_Message_Message=The Debug port you requested {0} is already in use.\nPlease select a different port in the PHP debug preferences.
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/communication/DebugConnectionThread.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/communication/DebugConnectionThread.java
index 58613dbcc..f1eddb243 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/communication/DebugConnectionThread.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/communication/DebugConnectionThread.java
@@ -567,7 +567,7 @@ public class DebugConnectionThread implements Runnable {
String contextRoot = launchConfiguration.getAttribute(Server.CONTEXT_ROOT, "");
boolean stopAtFirstLine = PHPProjectPreferences.getStopAtFirstLine(launchDecorator.getProject());
int requestPort = PHPProjectPreferences.getDebugPort(launchDecorator.getProject());
- boolean runWithDebug = launchConfiguration.getAttribute("run_with_debug", true);
+ boolean runWithDebug = launchConfiguration.getAttribute(IPHPConstants.RUN_WITH_DEBUG_INFO, true);
if (launch.getLaunchMode().equals(ILaunchManager.DEBUG_MODE)) {
runWithDebug = false;
}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/communication/DebuggerCommunicationDaemon.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/communication/DebuggerCommunicationDaemon.java
index 4875b3059..ce329d139 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/communication/DebuggerCommunicationDaemon.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/communication/DebuggerCommunicationDaemon.java
@@ -114,27 +114,41 @@ public class DebuggerCommunicationDaemon implements ICommunicationDaemon {
}
/**
+ * Returns true if this daemon is listening for communication requests.
+ * @return True, if the daemon is listening; False, otherwise.
+ */
+ public boolean isListening() {
+ synchronized (lock) {
+ return isAlive;
+ }
+ }
+
+ /**
* Initialize the ServerSocket to listen for debug requests on a specified port.
* The port is defined in the workspace preferences.
+ *
+ * @return True, if the reset did not yield any errors; False, otherwise.
*/
- public void resetSocket() {
+ public boolean resetSocket() {
stopListen();
int port = getReceiverPort();
try {
synchronized (lock) {
serverSocket = new ServerSocket(port);
startListen();
+ return true;
}
} catch (BindException exc) {
handleMultipleBindingError();
} catch (IOException e) {
Logger.logException("Error while restting the socket for the debug requests.", e);
}
+ return false;
}
public void handleMultipleBindingError() {
final int port = getReceiverPort();
- Logger.log(Logger.ERROR, "Port " + port + " is in use. Please select a different port for the debugger.");
+ Logger.log(Logger.ERROR, "The debug port " + port + " is in use. Please select a different port for the debugger.");
final Display display = Display.getDefault();
display.asyncExec(new Runnable() {
public void run() {

Back to the top