C++ and STL
  Common Issues
  Destructor
  regex
  string
 MFC
  CButton
  CDialog
  CEdit
  CInternetSession
  CWinThread
  CWnd
 MS VS FAQ
  Compiling, building
  Debugging
  Editor
  Settings
 Win32, API
  Console
  File System
  Graphics
  Internet functions
  Kernel objects
  Security
  Sound
  Thread, process
  Window
 Windows NT/2K*
  Logon, logoff...
  Networking
  Service Packs
 | About
  About
  Links & Freeware

Powered by
CoderTown



Debugging in Visual Studio - getting started.

Usually, newbie is in a hurry to build his own application and make it working and, of course use the debug features of the DE skin-deep. As a feedback he fails to fix some problem because even can't find out the reason. Let's try to find out how really the Visual Studio can help us.

Under MSVC debugger you can:

  • check conditions with alert message popup (ASSERT);
  • trace variables value (TRACE, Watch window);
  • watch functions call stack (Stack window);
  • determine memory leaks (DEBUG_NEW);

First, be aware there is a stand alone TRACER.EXE utility (see Microsoft Visual Studio 6.0 Tools) available to change some of debug key features

as well as Options/Debug tab page in MSVC

You can inspect variables and whole structures in Watch or Variables windows. You can expand structures and classes to see member values.

More over it's possible to make you own output format for the objects viewed!

Find a file autoexp.dat in \Program Files\Microsoft Visual Studio\Common\MSDev98\Bin or \Program Files\Microsoft Visual Studio .NET\Common7\Packages\Debugger\ for VS.NET.

It looks like this.

For instance, I added a line to check STLPort's strings:

_STL::_String_base<*> = <_M_start,s>

(For details see http://www.codeguru.com/debug/autoexp.shtml)

In Watch window you can use err,hr to get system error messages interpreted.


Created: 2003-05-12
Updated: 2003-05-12

Google
 
Web visualcpp.net
msdn.microsoft.com codeguru.com