[Pydev-cvs] org.python.pydev.debug/src/org/python/pydev/debug/model PyThread.java,1.2,1.3 PySourceLo
Brought to you by:
fabioz
From: Aleksandar T. <at...@us...> - 2004-04-28 02:49:57
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6529/src/org/python/pydev/debug/model Modified Files: PyThread.java PySourceLocator.java PyDebugTarget.java PyStackFrame.java Log Message: Stepping is done Index: PyThread.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PyThread.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyThread.java 27 Apr 2004 19:12:59 -0000 1.2 --- PyThread.java 28 Apr 2004 02:49:48 -0000 1.3 *************** *** 7,10 **** --- 7,11 ---- import org.eclipse.core.resources.IResource; + import org.eclipse.core.runtime.Platform; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.ILaunch; *************** *** 13,16 **** --- 14,18 ---- import org.eclipse.debug.core.model.IStackFrame; import org.eclipse.debug.core.model.IThread; + import org.eclipse.ui.views.tasklist.ITaskListResourceAdapter; /** *************** *** 163,167 **** public IStackFrame getTopStackFrame() throws DebugException { ! return stack == null ? stack[0] : null; } --- 165,169 ---- public IStackFrame getTopStackFrame() throws DebugException { ! return stack == null ? null : stack[0]; } *************** *** 175,180 **** adapter.equals(IResource.class)) return target.getAdapter(adapter); // ongoing, I do not fully understand all the interfaces they'd like me to support - System.err.println("PythonThread Need adapter " + adapter.toString()); return null; } --- 177,187 ---- adapter.equals(IResource.class)) return target.getAdapter(adapter); + else if (adapter.equals(ITaskListResourceAdapter.class)) + return null; + else { + System.err.println("PythonThread Need adapter " + adapter.toString()); + Platform.getAdapterManager().getAdapter(this, adapter); + } // ongoing, I do not fully understand all the interfaces they'd like me to support return null; } Index: PyStackFrame.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PyStackFrame.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyStackFrame.java 27 Apr 2004 19:12:59 -0000 1.1 --- PyStackFrame.java 28 Apr 2004 02:49:48 -0000 1.2 *************** *** 8,11 **** --- 8,12 ---- import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath; + import org.eclipse.core.runtime.IStatus; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.ILaunch; *************** *** 16,19 **** --- 17,21 ---- import org.eclipse.debug.core.model.IVariable; import org.eclipse.ui.views.tasklist.ITaskListResourceAdapter; + import org.python.pydev.debug.core.PydevDebugPlugin; /** *************** *** 37,40 **** --- 39,43 ---- } + public IPath getPath() { return path; *************** *** 64,74 **** public int getCharStart() throws DebugException { ! // TODO Auto-generated method stub ! return 0; } public int getCharEnd() throws DebugException { ! // TODO Auto-generated method stub ! return 0; } --- 67,75 ---- public int getCharStart() throws DebugException { ! return -1; } public int getCharEnd() throws DebugException { ! return -1; } *************** *** 168,170 **** --- 169,199 ---- } + /** + * HACK + * Here to work around eclipse2 annotation marker removal code. + * This makes sure that old stack markers get removed. + * E3 remove me in Eclipse 3 + */ + public int hashCode() { + return 5; + } + /** + * HACK + * Here to work around eclipse2 annotation marker removal code + * E3 remove me in Eclipse 3 + * LaunchView wants to know, + */ + public boolean equals(Object obj) { + if (obj instanceof PyStackFrame) + try { + return path.equals(((PyStackFrame)obj).getPath()) && + (line == ((PyStackFrame)obj).getLineNumber()); + } catch (DebugException e) { + PydevDebugPlugin.log(IStatus.ERROR, "PyStackFrame.equals", null); + return false; + } + else + return super.equals(obj); + } + } Index: PySourceLocator.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PySourceLocator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PySourceLocator.java 27 Apr 2004 19:12:59 -0000 1.1 --- PySourceLocator.java 28 Apr 2004 02:49:48 -0000 1.2 *************** *** 31,36 **** if (path != null) { IEditorPart part = PydevPlugin.getDefault().doOpenEditor(path, false); ! if (part != null) return part.getEditorInput(); } } --- 31,37 ---- if (path != null) { IEditorPart part = PydevPlugin.getDefault().doOpenEditor(path, false); ! if (part != null) { return part.getEditorInput(); + } } } Index: PyDebugTarget.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PyDebugTarget.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyDebugTarget.java 27 Apr 2004 19:12:59 -0000 1.2 --- PyDebugTarget.java 28 Apr 2004 02:49:48 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- import org.eclipse.debug.core.model.IStackFrame; import org.eclipse.debug.core.model.IThread; + import org.eclipse.ui.views.properties.IPropertySource; import org.python.pydev.debug.core.PydevDebugPlugin; *************** *** 32,35 **** --- 33,37 ---- * TODO Comment this class * Make sure we fire the right org.eclipse.debug.core.DebugEvents + * What happens with debug events? LaunchViewEventHandlerL:: */ public class PyDebugTarget implements IDebugTarget, ILaunchListener { *************** *** 215,218 **** --- 217,221 ---- return launch; else if (adapter.equals(IResource.class)) { + // used by Variable ContextManager, and Project:Properties menu item IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(file); if (files != null && files.length > 0) *************** *** 220,224 **** else return null; ! } else System.err.println("Need adapter " + adapter.toString()); --- 223,228 ---- else return null; ! } else if (adapter.equals(IPropertySource.class)) ! return launch.getAdapter(adapter); else System.err.println("Need adapter " + adapter.toString()); *************** *** 324,327 **** --- 328,333 ---- if (t != null) { t.setSuspended(true, (IStackFrame[])threadNstack[2]); + if (reason == DebugEvent.STEP_END) + System.out.println("need love"); fireEvent(new DebugEvent(t, DebugEvent.SUSPEND, reason)); } |