public boolean setValue(String expression) {
if (!verifyValue(expression))
return false;
- if( fTarget == null ) {
+ if( getDebugTarget() == null ) {
renderValueString(expression);
} else {
- if(fTarget.setVarValue(fVariable.getFullName(),expression)) {
+ if(((XDebugTarget) getDebugTarget()).setVarValue(fVariable.getFullName(),expression)) {
renderValueString(expression);
return true;
}
//import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.core.DebugEvent;
+//import org.eclipse.debug.core.DebugEvent;
//import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
+//import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.model.IDebugTarget;
public class XDebugElement extends PlatformObject implements IDebugElement {
// containing target
- protected/*private*/ XDebugTarget fTarget;
+ private XDebugTarget fTarget;
/**
* Constructs a new debug element contained in the given
*
* @param event the event to be fired
*/
- protected void fireEvent(DebugEvent event) {
- DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
- }
+// protected void fireEvent(DebugEvent event) {
+// DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
+// }
/**
* Fires a <code>CREATE</code> event for this element.
*/
- public void fireCreationEvent() {
- fireEvent(new DebugEvent(this, DebugEvent.CREATE));
- }
+// public void fireCreationEvent() {
+// fireEvent(new DebugEvent(this, DebugEvent.CREATE));
+// }
/**
* Fires a <code>RESUME</code> event for this element with
*
* @param detail event detail code
*/
- public void fireResumeEvent(int detail) {
- fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
- }
+// public void fireResumeEvent(int detail) {
+// fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
+// }
/**
* Fires a <code>SUSPEND</code> event for this element with
*
* @param detail event detail code
*/
- public void fireSuspendEvent(int detail) {
- fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
- }
+// public void fireSuspendEvent(int detail) {
+// fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
+// }
/**
* Fires a <code>TERMINATE</code> event for this element.
*/
- protected void fireTerminateEvent() {
- fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
- }
+// protected void fireTerminateEvent() {
+// fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
+// }
}
\ No newline at end of file
public IVariable[] getVariables() throws DebugException {
if (fVariables == null) {
- Node dfl = fTarget.getLocalVariables(fLevel);
- Node dfg = fTarget.getGlobalVariables(fLevel);
+ Node dfl = ((XDebugTarget) getDebugTarget()).getLocalVariables(fLevel);
+ Node dfg = ((XDebugTarget) getDebugTarget()).getGlobalVariables(fLevel);
parseVariable(dfl, dfg);
}
fSuspended = false;
XDebugCorePlugin.getBreakpointManager().removeBreakpointListener(this);
- fireTerminateEvent();
+ fThread.fireTerminateEvent();
DebugPlugin.getDefault().removeDebugEventListener(this);
/*if (fThread!=null)
fThread.removeEventListeners();*/
stopListener();
fDebugConnection.close();
- fThread.removeEventListeners();
+/* fThread.removeEventListeners();
fThread = null;
- fThreads = new IThread[0];
+ fThreads = new IThread[0];*/
/* stopListener();
fDebugConnection.close();*/
}
} else {
fDebugConnection = null;
- fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT));
- }
+ fThread.fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT));
+ }
+
+ fThread.removeEventListeners();
+ fThread = null;
+ fThreads = new IThread[0];
}
public void handleProxyEvent(/*String ideKey,*/ XDebugConnection connection) {
setDebugConnection(connection);
System.out.println("* New Connection - XDebug.Target: " + fDebugConnection.getSessionID());
- fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE));
+// fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE));
fThread = new XDebugThread(this);
fThreads = new IThread[] {fThread};
+ fThread.fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE));
try {
started();
} catch( DebugException e ){
* @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
*/
public boolean isSuspended() {
- return fTarget.isSuspended();
+// return fTarget.isSuspended();
+ return getDebugTarget().isSuspended();
}
/* (non-Javadoc)
*/
public void resume() throws DebugException {
fBreakpoints=null;
- fTarget.resume();
+ getDebugTarget().resume();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#suspend()
*/
public void suspend() throws DebugException {
- fTarget.suspend();
+ getDebugTarget().suspend();
}
/* (non-Javadoc)
*/
public void stepInto() throws DebugException {
fBreakpoints=null;
- fTarget.step_into();
+ ((XDebugTarget) getDebugTarget()).step_into();
}
/* (non-Javadoc)
*/
public void stepOver() throws DebugException {
fBreakpoints=null;
- fTarget.step_over();
+ ((XDebugTarget) getDebugTarget()).step_over();
}
/* (non-Javadoc)
*/
public void stepReturn() throws DebugException {
fBreakpoints=null;
- fTarget.step_out();
+ ((XDebugTarget) getDebugTarget()).step_out();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ITerminate#terminate()
*/
public void terminate() throws DebugException {
- fTarget.getDebugConnection().stop();
+ ((XDebugTarget) getDebugTarget()).getDebugConnection().stop();
fTerminated = true;
}
public void removeEventListeners() {
DebugPlugin.getDefault().removeDebugEventListener(this);
}
+
+ /**
+ * Fires a debug event
+ *
+ * @param event the event to be fired
+ */
+ protected void fireEvent(DebugEvent event) {
+ DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
+ }
+
+ /**
+ * Fires a <code>CREATE</code> event for this element.
+ */
+ public void fireCreationEvent() {
+ fireEvent(new DebugEvent(this, DebugEvent.CREATE));
+ }
+
+ /**
+ * Fires a <code>RESUME</code> event for this element with
+ * the given detail.
+ *
+ * @param detail event detail code
+ */
+ public void fireResumeEvent(int detail) {
+ fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
+ }
+
+ /**
+ * Fires a <code>SUSPEND</code> event for this element with
+ * the given detail.
+ *
+ * @param detail event detail code
+ */
+ public void fireSuspendEvent(int detail) {
+ fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
+ }
+
+ /**
+ * Fires a <code>TERMINATE</code> event for this element.
+ */
+ protected void fireTerminateEvent() {
+ fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
+ }
}
\ No newline at end of file
//import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugEvent;
+//import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.model.IValue;
import org.eclipse.debug.core.model.IVariable;
import org.w3c.dom.Node;
* @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
*/
public void setValue(String expression) throws DebugException {
- if(fValue.setValue(expression))
- fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT));
+ if(fValue.setValue(expression)) {
+
+ }
+ //fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT));
//fValue.setValueA(expression);
}