public abstract class XDebugAbstractValue extends XDebugElement implements IValue {
private IVariable[] fVariables;
protected String fValueString;
- /*protected*/private String fTypeName;
+ private String fTypeName;
private boolean fhasChanged;
public XDebugAbstractValue(XDebugStackFrame frame, Node varNode) throws DebugException {
- super((XDebugTarget) frame.getDebugTarget());
+ super(frame == null ? null : (XDebugTarget) frame.getDebugTarget());
fTypeName = PHPDebugUtils.getAttributeValue(varNode,"type");
*/
package net.sourceforge.phpeclipse.xdebug.php.model;
+//import java.io.ByteArrayInputStream;
+//import java.io.IOException;
import java.util.List;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
import net.sourceforge.phpeclipse.xdebug.core.IPHPDebugEvent;
import net.sourceforge.phpeclipse.xdebug.core.IProxyEventListener;
import net.sourceforge.phpeclipse.xdebug.core.IXDebugPreferenceConstants;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IThread;
+import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+//import org.xml.sax.SAXException;
import net.sourceforge.phpeclipse.xdebug.core.xdebug.ResponseListener;
import net.sourceforge.phpeclipse.xdebug.core.xdebug.XDebugConnection;
}
}
- public Node eval(String expression) {
- int id = fDebugConnection.eval(expression);
- XDebugResponse response = getResponse(id);
-
- Node evalResponse = response.getParentNode();
- Node evalProperty = evalResponse.getFirstChild();
+ public Node eval(String expression) throws DebugException {
+ Node evalProperty = null;
+ if (fDebugConnection != null) {
+ int id = fDebugConnection.eval(expression);
+ //Node evalProperty = new Node("");
+ //if (id > 0) {
+ XDebugResponse response = getResponse(id);
+
+ Node evalResponse = response.getParentNode();
+ /*Node*/ evalProperty = evalResponse.getFirstChild();
+ //} /*else {
+
+ //}*/
+ } else {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = null;
+ Document doc = null;
+
+ try {
+ builder = factory.newDocumentBuilder();
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ }
+ //try {
+ doc = builder.newDocument(); // .parse("");
+ evalProperty = doc.createElement("value");
+ /*} catch (SAXException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }*/
+ }
return evalProperty;
}
* @param name variable name
*/
public XDebugVariable(XDebugStackFrame frame, Node property) throws DebugException {
+ super((XDebugTarget) frame.getDebugTarget());
if (frame != null ) {
- //super((XDebugTarget) frame.getDebugTarget());
fFrame = frame;
}
*
* @return the stack frame owning this variable
*/
- protected XDebugStackFrame getStackFrame() {
+ /*protected XDebugStackFrame getStackFrame() {
return fFrame;
- }
+ }*/
public String getValueString() throws DebugException {
return fValue.getValueString();
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.ILineBreakpoint;
return getBreakpointText((IBreakpoint) element);
} else if (element instanceof XDebugVariable) {
XDebugVariable phpVar = (XDebugVariable) element;
- return phpVar.toString();
+ return phpVar.getName() + "= " + phpVar.getValueString();//toString();
}
} catch (CoreException e) {
//return PHPDebugUiMessages
* @see IDebugModelPresentation#computeDetail(IValue, IValueDetailListener)
*/
public void computeDetail(IValue value, IValueDetailListener listener) {
- return;
+ String detail = "";
+ try {
+ detail = value.getValueString();
+ } catch (DebugException e) {
+ }
+ listener.detailComputed(value, detail);
+ //return;
}
protected IBreakpoint getBreakpoint(IMarker marker) {