-/**
- *
- */
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
*/
package net.sourceforge.phpeclipse.xdebug.php.model;
+import java.net.MalformedURLException;
import java.net.URL;
-//import net.sourceforge.phpeclipse.xdebug.core.Base64;
-//import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils;
-//import net.sourceforge.phpeclipse.xdebug.core.xdebug.ResponseListener.DebugResponse;
-//import net.sourceforge.phpeclipse.xdebug.core.xdebug.ResponseListener.XDebugResponse;
-
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugException;
* @param data frame data
* @param id stack frame id (0 is the bottom of the stack)
*/
- public XDebugStackFrame(XDebugThread thread, int id) {
+ public XDebugStackFrame(XDebugThread thread, int id, String type, int lineNumber, String where, /*URL*/String filename) {
super(thread == null ? null : (XDebugTarget) thread.getDebugTarget());
+
fId = id;
+ fLevel = id;
fThread = thread;
+ fType = type;
+ fLineNumber = lineNumber;
+ fWhere = where;
+
+ try {
+ fName = new URL(filename);
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
}
public void incrementStepCounter() {
* @see org.eclipse.debug.core.model.IStackFrame#getName()
*/
public String getName() throws DebugException {
- //String a = fName.getFile();
- //return fName.lastSegment().toString()+"::"+fWhere+ " line: "+ fLineNumber;
return fName.toString()+"::"+fWhere+ " line: "+ fLineNumber;
}
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
-// return getSourceName().hashCode() + fId;
return getSourceName().hashCode() + fLevel;
}
*
* @return this stack frame's unique identifier within its thread
*/
- protected int getIdentifier() {
+ /*protected int getIdentifier() {
return fId;
- }
-
-
- public void setFullName(URL name) {
- fName = name;
- }
-
+ }*/
public URL getFullName() {
return fName;
return fLevel;
}
- public void setLevel(int level) {
- fLevel = level;
- fId = level;
- }
-
public String getType() {
return fType;
}
- public void setType(String type) {
- fType = type;
- }
-
public String getWhere() {
return fWhere;
}
- public void setWhere(String where) {
- fWhere = where;
- }
-
- public void setLineNumber(int newlineNumber) {
- fLineNumber = newlineNumber;
+ public boolean setVariableValue(XDebugVariable variable, String expression) throws DebugException {
+ return ((XDebugTarget) getDebugTarget()).setVarValue("$" + variable.getName(), expression);
}
}
\ No newline at end of file