From 74ee3534d949f9cdb3d480cf9cf75622009c24f1 Mon Sep 17 00:00:00 2001 From: incastrix Date: Tue, 16 Sep 2008 17:50:17 +0000 Subject: [PATCH] Change visibility to private for net.sourceforge.phpeclipse.xdebug.php.model.XDebugElement.fTarget --- .../xdebug/php/model/XDebugAbstractValue.java | 4 +- .../phpeclipse/xdebug/php/model/XDebugElement.java | 36 ++++++------ .../xdebug/php/model/XDebugStackFrame.java | 4 +- .../phpeclipse/xdebug/php/model/XDebugTarget.java | 17 ++++-- .../phpeclipse/xdebug/php/model/XDebugThread.java | 58 +++++++++++++++++--- .../xdebug/php/model/XDebugVariable.java | 8 ++- 6 files changed, 89 insertions(+), 38 deletions(-) diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugAbstractValue.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugAbstractValue.java index 96f14f2..5056d77 100644 --- a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugAbstractValue.java +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugAbstractValue.java @@ -154,10 +154,10 @@ public abstract class XDebugAbstractValue extends XDebugElement implements IVal 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; } diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugElement.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugElement.java index c84a976..8e08bc4 100644 --- a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugElement.java +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugElement.java @@ -9,9 +9,9 @@ import net.sourceforge.phpeclipse.xdebug.php.launching.IXDebugConstants; //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; @@ -24,7 +24,7 @@ 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 @@ -81,16 +81,16 @@ public class XDebugElement extends PlatformObject implements IDebugElement { * * @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 CREATE event for this element. */ - public void fireCreationEvent() { - fireEvent(new DebugEvent(this, DebugEvent.CREATE)); - } +// public void fireCreationEvent() { +// fireEvent(new DebugEvent(this, DebugEvent.CREATE)); +// } /** * Fires a RESUME event for this element with @@ -98,9 +98,9 @@ public class XDebugElement extends PlatformObject implements IDebugElement { * * @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 SUSPEND event for this element with @@ -108,14 +108,14 @@ public class XDebugElement extends PlatformObject implements IDebugElement { * * @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 TERMINATE 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 diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrame.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrame.java index 5fbece5..b292684 100644 --- a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrame.java +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrame.java @@ -71,8 +71,8 @@ public class XDebugStackFrame extends XDebugElement implements IStackFrame { 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); } diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugTarget.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugTarget.java index 9b7b206..ee034ec 100644 --- a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugTarget.java +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugTarget.java @@ -177,7 +177,7 @@ public class XDebugTarget extends XDebugElement implements IDebugTarget, IDebugE fSuspended = false; XDebugCorePlugin.getBreakpointManager().removeBreakpointListener(this); - fireTerminateEvent(); + fThread.fireTerminateEvent(); DebugPlugin.getDefault().removeDebugEventListener(this); /*if (fThread!=null) fThread.removeEventListeners();*/ @@ -557,9 +557,9 @@ public class XDebugTarget extends XDebugElement implements IDebugTarget, IDebugE stopListener(); fDebugConnection.close(); - fThread.removeEventListeners(); +/* fThread.removeEventListeners(); fThread = null; - fThreads = new IThread[0]; + fThreads = new IThread[0];*/ /* stopListener(); fDebugConnection.close();*/ @@ -575,18 +575,23 @@ public class XDebugTarget extends XDebugElement implements IDebugTarget, IDebugE } } 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 ){ diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugThread.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugThread.java index 91d1868..ed32941 100644 --- a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugThread.java +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugThread.java @@ -204,7 +204,8 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended() */ public boolean isSuspended() { - return fTarget.isSuspended(); +// return fTarget.isSuspended(); + return getDebugTarget().isSuspended(); } /* (non-Javadoc) @@ -212,14 +213,14 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS */ 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) @@ -259,7 +260,7 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS */ public void stepInto() throws DebugException { fBreakpoints=null; - fTarget.step_into(); + ((XDebugTarget) getDebugTarget()).step_into(); } /* (non-Javadoc) @@ -267,7 +268,7 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS */ public void stepOver() throws DebugException { fBreakpoints=null; - fTarget.step_over(); + ((XDebugTarget) getDebugTarget()).step_over(); } /* (non-Javadoc) @@ -275,7 +276,7 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS */ public void stepReturn() throws DebugException { fBreakpoints=null; - fTarget.step_out(); + ((XDebugTarget) getDebugTarget()).step_out(); } /* (non-Javadoc) @@ -296,7 +297,7 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS * @see org.eclipse.debug.core.model.ITerminate#terminate() */ public void terminate() throws DebugException { - fTarget.getDebugConnection().stop(); + ((XDebugTarget) getDebugTarget()).getDebugConnection().stop(); fTerminated = true; } @@ -321,4 +322,47 @@ public class XDebugThread extends XDebugElement implements IThread, IDebugEventS 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 CREATE event for this element. + */ + public void fireCreationEvent() { + fireEvent(new DebugEvent(this, DebugEvent.CREATE)); + } + + /** + * Fires a RESUME 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 SUSPEND 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 TERMINATE event for this element. + */ + protected void fireTerminateEvent() { + fireEvent(new DebugEvent(this, DebugEvent.TERMINATE)); + } } \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugVariable.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugVariable.java index 9bd587e..f8c54bd 100644 --- a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugVariable.java +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugVariable.java @@ -10,7 +10,7 @@ import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils; //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; @@ -130,8 +130,10 @@ public class XDebugVariable extends XDebugElement implements IVariable/*, IWatc * @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); } -- 1.7.1