Posts Tagged ‘VC Debugger’

Seeing array values in the debugger as a list!

VC debuggger has a nice feature to display array values. It works with any contiguous data, for e.g. vector, CArray, native type arrays etc.

Follow these steps…

  1. IntVector is an array of integers
  2. Start quick watch by pressing Shift + F9 with IntVector object selected
  3. Select _First(encircled in red) and press Add watch(encircled in red)
  4. You should see _First in the watch window
  5. So now put a comma after _First and add number of elements to view

Here is a screen shot of how I get to see a vector’s array values in the debugger.

Watch demo

See above result in watch window, easy isn’t it? Works in the same way for other array types too!

So have a great time debugging arrays 😉

Conditional breakpoint

June 14, 2007 2 comments

How to set a conditional breakpoint

Add this code to your common include or some file where it’s meant to be used…

#ifdef _DEBUG
    #define CBREAK( condition ) if(( condition )){ _asm int 3; }
    #define CBREAK( condition )

//How to use this macro…
void SomeFunction()
    for( int nIndex = 0; nIndex < 100; ++nIndex )     {         ...         CBREAK( nIndex == 32 );     } }[/sourcecode]

%d bloggers like this: