**********************************************************************/
package net.sourceforge.phpdt.internal.debug.core.model;
+import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.model.IThread;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.model.IWorkbenchAdapter;
public class PHPThread implements IThread {
return target;
}
+ public void setDebugTarget(IDebugTarget target) {
+ this.target= target;
+ }
+
public ILaunch getLaunch() {
return this.getDebugTarget().getLaunch();
}
public void resume() throws DebugException {
this.prepareForResume() ;
- ((PHPDebugTarget) this.getDebugTarget()).getPHPDBGProxy().resume(this);
+ ((PHPDebugTarget) this.getDebugTarget()).getPHPDBGProxy().resume();
}
/*
*/
public void suspend() {
- isStepping = false ;
+ isStepping = false;
isSuspended = true;
DebugEvent ev = new DebugEvent(this, DebugEvent.SUSPEND, DebugEvent.BREAKPOINT);
DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { ev });
public void terminate() throws DebugException {
isTerminated = true;
this.frames = null;
+ getDebugTarget().terminate();
}
public Object getAdapter(Class arg0) {
+ if (IWorkbenchAdapter.class.equals(arg0)) {
+ return new IWorkbenchAdapter() {
+ public Object[] getChildren(Object o) {
+ Object[] children = null;
+ try {
+ IStackFrame[] frames = getStackFrames();
+ if (null != frames) {
+ children = new Object[frames.length];
+ for (int i = 0; i < frames.length; ++i)
+ children[i] = frames[i];
+ }
+ } catch (DebugException x) {
+ PHPeclipsePlugin.log("Unable to get stack frames.", x);
+ }
+ return children;
+ }
+ public ImageDescriptor getImageDescriptor(Object object) {
+ return null;
+ }
+ public String getLabel(Object o) {
+ throw new UnsupportedOperationException();
+ }
+ public Object getParent(Object o) {
+ return getDebugTarget();
+ }
+ };
+ }
return null;
}