« Adobe Library that is required for Phylo Lab. | Main | Phylogenetics Project (due 2/16) »

February 04, 2005

Debugging

If you can't debug, then you are probably going to struggle with the projects. If you can't see what your program is doing, then you can't debug. Here's some ideas on debugging in VisualStudio.

Keep in mind that the help functionality of VisualStudio is actually pretty good and that we have free online access to the O'Reilly books.

  • First off, the interactive debug capabilities of visualStudio are pretty good. Its worth your time to learn the key shortcuts etc so you don't have to hunt and click everything. (If you know gdb really well, then you will probably find visualStudio's interface annoying. That is, until you learn it as well as you've learned gdb's interface.)

    On really slow machines, interactive debugging may become annoying. Here's some more ideas.

  • Write to the console. You are probably familiar with this approach in linux. In visualStudio, you use "Console.Writeline" and then its almost the same. The handling of strings, numbers etc. is a little different. See the documentation for details.

    The other trick is finding the console. The console is one of the tabs on your output pane in the visualStudio cockpit. In my set up, its on the bottom left corner of the screen.

  • The final method is to make your own scrolling textbox in your program and write to it. To add a scrolling text box, edit your interface, add a textbox and enable the multiline and scroll methods. Give the textbox a name and set the "TextBox.Text" member to be whatever you'd like. Note that something like
     
    TextBox.Text = TextBox.Text + "new message";

    will simulate scrolling through messages.

    Post your comments, suggestions here.

Posted by jones at February 4, 2005 12:46 PM

Comments

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?