From 854ee98a0911195fa117fbf496e16c2d98239f2f Mon Sep 17 00:00:00 2001 From: fvicente Date: Wed, 30 Jul 2003 01:10:37 +0000 Subject: [PATCH] First submit for debug plugin --- .../os/win32/x86/Environment.dll | Bin 0 -> 12288 bytes .../phpdt/debug/core/PHPDebugModel.java | 185 ++++++++++++++++++++ 2 files changed, 185 insertions(+), 0 deletions(-) create mode 100644 net.sourceforge.phpeclipse.debug.core/os/win32/x86/Environment.dll create mode 100644 net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/debug/core/PHPDebugModel.java diff --git a/net.sourceforge.phpeclipse.debug.core/os/win32/x86/Environment.dll b/net.sourceforge.phpeclipse.debug.core/os/win32/x86/Environment.dll new file mode 100644 index 0000000000000000000000000000000000000000..62cdb624a2039670807e6fd5ab6bce6a9abc789c GIT binary patch literal 12288 zcmeHNe{5UD9X~s!bHNk?*#soq!V+Bnc!`}lwq-xJ zMKoI~4++aettO-)jXz-U2htdtRQ`y7P7%pOVMSsRj8-5mnwVrM8LLJH88h)d-+S-u z_mVn(jA{eclg{t%d!PH>_w&7b_uhS3ctLUB}oa3u7~E)!M5p*4x=CfE+4t=e4*xk-K=^$;(#80OyJ9=P8R{ ztwOwbC+bHX_*J_c#FaV+8QTdxP19b+6l!!a*4q^H`5Qcne3bNNufPxN;@3I}RiBHo zgPvSGqC~W@A>cM#skVz>h=U###v~GUG4-nXPT+!!O?r|lkaLEBU)KnPdOb+EoSe$U z7&}HH_<tL@^~#hBG2tNOSv4{AR32!whCE@+fou6%?snTg*=nO( zPPwMM-EA-Tx}7EK1l>eaJ^S`U9rNd>%DJZpG&N ztzfV0#C<9Q zmjfN_Kv7*fG5frCa`r~jGhFMbe6&dY9K%;t+F&F!2s>3C#ZiZ)a7Cp9{3^TQxmp2) z9N_dc?n!6uEs%QsRR`mo9Q#4~u+j;0!>>_Ik1h_DLyKc)9fNT0`H|{-1M}xc7R#Y|KvdJ)F&(dk=4l!$MQom>snWoO*|lSv zzeA!eN?R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U_qacF!eYAHD}>A!Q%a(7`-V|>11n6fTCzBi|dROv|1kbsj#`h!fAp< zrwJA_tu2%uZ;c619I*LZs39_8bAv^P2^Q;3u=t?0h0+tPF#(EXHf5p3_Jqw17M&(o zbeUjLX>FnOWNS=-VzEtGXkkfVbAyFsf`w#)#awF(rKehB0uw8-&;qK$<_3$P2^Jeo zu(;6LLh0Gom;lAY)wx)H(hRGiU?yyCu;@0yVzUVr^Q|qEo@P(;7!iqZnv!sZ5x z114AmO|V#KZK3phYfRwWiY(L+ys){!B5s1kb`vbBtu2&((;5??uPV*wLj8CkY_>A` z%SSlemzQ&)w32&hZwB!)2($gY$|+wHc{9AU98aHxFdp7rx|7k}2pa{xG=361OfJTJ=T@*KJ9(Md&)cM{hjw6?|a@0-k + * Clients are not intended to instantiate or subclass this class; + * this class provides static utility methods only. + *

+ */ +public class PHPDebugModel { + + /** + * Not to be instantiated. + */ + private PHPDebugModel() { + super(); + } + + /** + * Returns the identifier for the PHP debug model plug-in + * + * @return plugin identifier + */ + public static String getPluginIdentifier() { + return PHPDebugCorePlugin.getUniqueIdentifier(); + } + + /** + * Creates and returns a line breakpoint in the type with + * at the given line number. The marker associated with the + * breakpoint will be created on the specified resource. If a character + * range within the line is known, it may be specified by charStart/charEnd. + * If hitCount is > 0, the breakpoint will suspend execution when it is + * "hit" the specified number of times. + * + * @param resource the resource on which to create the associated breakpoint + * marker + * @param lineNumber the lineNumber on which the breakpoint is set - line + * numbers are 1 based, associated with the source file in which + * the breakpoint is set + * @param charStart the first character index associated with the breakpoint, + * or -1 if unspecified, in the source file in which the breakpoint is set + * @param charEnd the last character index associated with the breakpoint, + * or -1 if unspecified, in the source file in which the breakpoint is set + * @param hitCount the number of times the breakpoint will be hit before + * suspending execution - 0 if it should always suspend + * @param register whether to add this breakpoint to the breakpoint manager + * @param attributes a map of client defined attributes that should be assigned + * to the underlying breakpoint marker on creation, or null if none. + * @return a line breakpoint + * @exception CoreException If this method fails. Reasons include:
    + *
  • Failure creating underlying marker. The exception's status contains + * the underlying exception responsible for the failure.
+ * @since 2.0 + */ + public static void createLineBreakpoint(IResource resource, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException { + if (attributes == null) { + attributes = new HashMap(10); + } + new PHPLineBreakpoint(resource, lineNumber, charStart, charEnd, hitCount, true, attributes); + } + + /** + * Returns true if line breakpoint is already registered with the breakpoint + * manager for the given line number. + * + * @param typeName fully qualified type name + * @param lineNumber line number + * @return true if line breakpoint is already registered with the breakpoint + * manager for the given line number or false + * if no such breakpoint is registered + * @exception CoreException If this method fails. + */ + public static boolean lineBreakpointExists(int lineNumber) throws CoreException { + String modelId= getPluginIdentifier(); + String markerType= PHPLineBreakpoint.getMarkerType(); + IBreakpointManager manager= DebugPlugin.getDefault().getBreakpointManager(); + IBreakpoint[] breakpoints= manager.getBreakpoints(modelId); + for (int i = 0; i < breakpoints.length; i++) { + if (!(breakpoints[i] instanceof PHPLineBreakpoint)) { + continue; + } + PHPLineBreakpoint breakpoint = (PHPLineBreakpoint) breakpoints[i]; + if (breakpoint.getMarker().getType().equals(markerType)) { + if (breakpoint.getLineNumber() == lineNumber) { + return true; + } + } + } + return false; + } + + /** + * Returns the preference store for this plug-in or null + * if the store is not available. + * + * @return the preference store for this plug-in + */ + public static Preferences getPreferences() { + PHPDebugCorePlugin deflt= PHPDebugCorePlugin.getDefault(); + if (deflt != null) { + return deflt.getPluginPreferences(); + } + return null; + } + + /** + * Saves the preference store for this plug-in. + * + * @return the preference store for this plug-in + */ + public static void savePreferences() { + PHPDebugCorePlugin.getDefault().savePluginPreferences(); + } + + /** + * Creates and returns a debug target for the given VM, with + * the specified name, and associates the debug target with the + * given process for console I/O. The allow terminate flag specifies whether + * the debug target will support termination (ITerminate). + * The allow disconnect flag specifies whether the debug target will + * support disconnection (IDisconnect). The resume + * flag specifies if the target VM should be resumed on startup (has + * no effect if the VM was already running when the connection to the + * VM was esatbished). Launching the actual VM is a client responsibility. + * The debug target is added to the given launch. + * + * @param launch the launch the new debug target will be contained in + * @param vm the VM to create a debug target for + * @param name the name to associate with the VM, which will be + * returned from IDebugTarget.getName. If null + * the name will be retrieved from the underlying VM. + * @param process the process to associate with the debug target, + * which will be returned from IDebugTarget.getProcess + * @param allowTerminate whether the target will support termianation + * @param allowDisconnect whether the target will support disconnection + * @param resume whether the target is to be resumed on startup. Has + * no effect if the target was already running when the connection + * to the VM was established. + * @return a debug target + * @see org.eclipse.debug.core.model.ITerminate + * @see org.eclipse.debug.core.model.IDisconnect + * @since 2.0 + */ + /* + public static IDebugTarget newDebugTarget(final ILaunch launch, final String name, final IProcess process) { + final IDebugTarget[] target = new IDebugTarget[1]; + IWorkspaceRunnable r = new IWorkspaceRunnable() { + public void run(IProgressMonitor m) { + target[0]= new PHPDebugTarget(launch, process); + } + }; + try { + ResourcesPlugin.getWorkspace().run(r, null); + } catch (CoreException e) { + //PHPDebugPlugin.log(e); + } + return target[0]; + } + */ +} -- 1.7.1