Reputation: 4695
I'm developing in visual studio 2013, and have a couple of questions regarding debugging:
Is it possible to have a group of breakpoints that I can enable/disable all together? Sometimes I may be working on feature 'a' and then need to work on feature 'b'. Being able to group breakpoints, and disable them all at once would be very handy!
Is it possible to have a variable with one value for the debug build, and another for the release build? Working with opencv, and when I'm in the debug mode, I like to see data on the image that isn't to be shown in the release, so I've set up one bool variable to control this that I have to keep changing when switching builds!
Upvotes: 1
Views: 142
Reputation: 20862
1 - Yes, as of VS 2010 you can label breakpoints into groups.
http://msdn.microsoft.com/en-us/library/vstudio/dd293674(v=vs.100).aspx http://weblogs.asp.net/scottgu/vs-2010-debugger-improvements-breakpoints-datatips-import-export
Briefly, right click on a breakpoint, click Edit Labels..., then either Add a new one (Ex. parser), or select a previous one. To toggle groups by label, go to the Breakpoints window (Debug -> Windows -> Breakpoints), and change the criteria "In Column" to Labels, and type parser into Search. Then you can toggle the results.
2 - Use conditional compilation macros
#ifdef DEBUG
int verbose = 1;
#else
int verbose = 0;
#endif
Upvotes: 2
Reputation: 409482
For the second questions, you can use the pre-processor conditional features:
#ifdef DEBUG
// Building debug variant
#else
// Building something else
#endif
Upvotes: 0