If you are using VS 2005, regardless of which compiler you have used, debugging
a serial code is a snap. To make things even easier add the debug toolbar from View | Toolbars | Debug.
This gives you icons for stepping into, stepping over and stepping out of code.
It also gives you a breakpoints pane which lists all of the breakpoints you have
set and gives you the ability to set conditions on these breakpoints by right clicking
on a breakpoint and going to its properties. You can set conditions for when
to hit the break point and/or the number of hits to take at the breakpoint before
actually pausing the code.
VS 2005 creates a debug version of your code by default,
so all you need to do is set a breakpoint and run. To set a breakpoint, put the
insertion point (it shows up as a vertical bar) on an executable line and hit the
F9 key or click in the left margin of an executable
line. A solid dot appears in the left margin indicating that a breakpoint has been
set. To run, click on the Start icon (just to the left of the breakpoint
icon) or use the F5 key. When the job stops, a yellow arrow appears on top
of the breakpoint dot and "(Debugging)" is added to the end of the window
title.
When you are at a breakpoint you can examine variables (and change their values),
set variables to watch, view the call stack, examine registers, step through the
code, or look at assembly code. The Intel compiler also comes with an array
visualizer that allows you to look at whole arrays both in graphical and spreadsheet
format.
An alternative debugger is the Intel Windows Application Debugger. You can invoke
it from the Desktop at Start | All Programs |
Intel(R) Software Development Tools | Intel(R) Debugger 9.1 |
Environment for IA-32 applications (GUI). It is also available as a
command-line debugger by choosing the option on the path above without the 'GUI"
qualifier. You can use this debugger for either C or Fortran code. It can also be
invoked from the command prompt:
"C:\Program Files\Intel\[CPP|Fortran]\IDB80\bin\idb.exe".