-/**
- *
- */
package net.sourceforge.phpeclipse.xdebug.core.xdebug;
import java.io.DataInputStream;
import net.sourceforge.phpeclipse.xdebug.core.Base64;
import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils;
import net.sourceforge.phpeclipse.xdebug.core.XDebugCorePlugin;
-//import net.sourceforge.phpeclipse.xdebug.core.xdebug.ResponseListener.XDebugResponse;
import org.eclipse.core.runtime.IStatus;
}
private /*XDebugResponse*/ int sendRequest(String command, String arguments) {
- int id = -1;
-
- id = _sendRequest(command, arguments);
-
- //XDebugResponse response = getResponse(id);
-
- return /*response*/ id;
+ return _sendRequest(command, arguments);
}
private synchronized int _sendRequest(String command, String arguments) {
return sendRequest("feature_get","-n "+featureName);
}
- public /*boolean*/ int featureSet(String featureName, String value) {
- //XDebugResponse id = sendRequest("feature_set","-n "+featureName + " -v " + value);
-
- int id = sendRequest("feature_set","-n "+featureName + " -v " + value);
-
- return id;
- /*XDebugResponse response = getResponse(id);
-
- if (response.getAttributeValue("success").equals("1") )
- return true;
- else
- return false;*/
- }
-
- /*protected XDebugResponse getResponse(int id) {
- return fResponseList.get(id);
+ public int featureSet(String featureName, String value) {
+ return sendRequest("feature_set","-n "+featureName + " -v " + value);
}
- protected void addResponse(XDebugResponse response, int id) {
- fResponseList.add(response, id);
- }*/
-
public /*XDebugResponse*/ int breakpointSetOld(String file, int lineNumber) {
- String arg;
-
- arg = "-t line -f file://"+PHPDebugUtils.escapeString(file)+" -n " + lineNumber;
+ String arg = "-t line -f file://"+PHPDebugUtils.escapeString(file)+" -n " + lineNumber;
return sendRequest("breakpoint_set", arg);
}
public /*XDebugResponse*/ int breakpointSet(String file, int lineNumber, int hitCount) {
- String arg;
-
- arg = "-t line -f file://"+PHPDebugUtils.escapeString(file)+" -n " + lineNumber;
+ String arg = "-t line -f file://"+PHPDebugUtils.escapeString(file)+" -n " + lineNumber;
if (hitCount > 0) {
arg += " -h " + hitCount;
}
}
public int breakpointGet(int id) {
- String arg;
+ String arg = "-d " + id;
- arg = "-d " + id;
return sendRequest("breakpoint_get", arg);
}
}
public /*XDebugResponse*/ int stackGet(/*int Level*/) {
- /*if (Level > -1) {
- return sendRequest("stack_get", "-d " + Level);
- } else {*/
- return sendRequest("stack_get", "");
- //}
+ return sendRequest("stack_get", "");
}
public void stepOver() {
String str = Base64.encodeBytes(Value.getBytes());
int len = str.length();
- return sendRequest("property_set", "-n " + Name + " -l " + len + " -- " + str);
+ return sendRequest("property_set", "-n " + Name + " -d 0 -l " + len + " -- " + str);
}
public /*XDebugResponse*/ int contextGet(int Level, int Type) {
return sendRequest("context_get", "-d " + Level + " -c " + Type);
}
- public /*boolean*/int setVarValue(String Name, String Value) {
- //XDebugResponse dr = propertySet(Name, Value);
-
- int id = propertySet(Name, Value);
- //XDebugResponse response = getResponse(id);
- return id;
-
- /*if ((response.getAttributeValue("success")).equals("1"))
- return true;
-
- return false;*/
- }
-
- /*public void startListener() {
- fResponseListener.schedule();
+ public int setVarValue(String Name, String Value) {
+ return propertySet(Name, Value);
}
- public boolean stopListener() {
- return fResponseListener.cancel();
- }*/
-
public void close() {
if (!fIsClosed) {
fIsClosed = true;
- //fResponseListener.cancel();
- //fResponseListener = null;
try {
fDebugSocket.close();
fDebugReader.close();
- fDebugReader = null;
+ //fDebugReader = null;
fDebugWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}
- //fResponseListener.cancel();
- //fIsClosed=true;
}
}
\ No newline at end of file