[Backalaika-developers] Debugging with SharpDevelop
Status: Beta
Brought to you by:
nandof
From: Nando F. <nan...@ma...> - 2004-09-26 04:18:41
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> <h1>Debugging with SharpDevelop</h1> <p>Currently, debugging is not supported by Sharp Develop. Here we will show three different approaches to debugging your code:</p> <h2>1 - the minimalist approach</h2> <p>If you really need to do some debugging, you can use cordbg.exe, which is included in the .NET SDK, to debug your application.</p> <p>When you get the message "This application has generated an unhandled exception.", follow these steps:</p> <ul> <li> Press <em>'cancel</em> on the above dialog. A new dialog will pop up.</li> <li> Run <strong>cordbg.exe</strong> from your .NET Sdk \bin directory, with the process id listed on the new dialog. You should have a commandline something like this: <strong>C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\cordbg.exe</strong> !a 0xfff27fc1 where <em>0xfff27fc1</em> is the process id.</li> <li> Press <strong>Retry</strong> on the dialog. This will cause cordbg to emit debugging info.</li> <li> You can use the text highlighter on the console window to highlight and copy the text in the console window.</li> <li> When you're done, type <strong>q</strong> at the console prompt.</li> </ul> <p>If you add the location of cordbg.exe to your path and then restart Sharp Develop, you can skip steps 2 and 3. Clicking the cancel button in the first dialog will fire up a cordbg console automatically. [ver 0.95]</p> <h2>2 - How to Debug with a GUI</h2> <p>At first I hated SD for not bringing along a debugger of its own, but then I realised a good debugger ships with the SDK.</p> <ul> <li> Run <strong>C:\Program Files\Microsoft.NET\FrameworkSDK\GuiDebug\dbgclr.exe</strong></li> <li> Choose <em>Debug - Program</em> to Debug in the Menu.</li> <li> In the appearing dialog, enter the path to your .net program and press OK.</li> <li> Run the program pressing the <em>play</em> button <em>></em>.</li> <li> Break the program using the <em>pause</em> button <em>||</em>.</li> </ul> <p>The sourcecode at its current position should appear. Now you can right click on <em>Miscellaneous Files</em> and open source code files. In there, you can add breakpoints, watches, etc. It's pretty comfortable.</p> <h2> 3 - How to Debug with a GUI (the easy way)</h2> <ul> <li> Add a new Tool (<em>Tools->Options->Tools->External Tools->Add</em>)</li> <li> Title it <em>Debugger</em> or something like that</li> <li> In <strong>Command</strong> search for <strong>DbgCLR.exe</strong> (usually in <em>C:\Program Files\Microsoft.NET\SDK\v1.1\GuiDebug\DbgCLR.exe</em>)</li> <li> In <strong>Arguments</strong> type "${<span id="id275" style="display: none;">add a one or paragraph summary or description of what's discussed here; put yours after 'Summary:' <div class="TopicTipStats">09.06.2004 22:39:21 - kbit</div> </span><a onmouseover='TopicTipOn(this, "id275");' onmouseout="TopicTipOff();" href="http://wiki.sharpdevelop.net/default.aspx/SharpDevelop.TargetPath">TargetPath</a>}" (<strong>NOTE: type the quotes too!</strong>)</li> <li> Hit the OK-Button</li> </ul> <p>Now you can start the debugger with a single click!</p> </body> </html> |