Don't stop on Breakpoint setting in VS 2008?

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I have a program and I have breakpoints throughout the code, some active and some disabled. To effectively test the program I need to have it run for a while without interference and then use breakpoints to check the state of things.

It is too time consuming and difficult to delete or disable every breakpoint until I want to check the state and enabling all break pints does not work as some break points should stay disabled.

Right now I run the program without debugging which works great until I want to check what is going on.

I am wondering if there is any way to have VS completely ignore breakpoints in debug mode. Something similar to how I can choose to stop on handled exceptions.

One way is if the source file does not match the original file, so changing the original file in a text editor is a bad way to do what I want, and then change it back. But I am hoping there is a better, more reliable way to accomplish this?

Thanks
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
You can build your app for Debug and then 'Start without Debugging' from the Debug menu. When it's time for you to actually start debugging just go into the Debug menu and select attach to running process, then select your app.
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
That sounds like it would work. I am using VS 2008 C# Express, which should still have Attach running process enabled, but I don't have this option available. Any ideas?

Also, reading about the option, I found that the compiled source and the debugging source have to be the same. So the question is would it be possible to edit the source code in this manner or would I just need keep a record of the changes and make the changes when the program is not running?

Thanks again.
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
More research on MSDN shows that attaching a running process is not supported under 2008 express.
I also noticed that Pro also supports break-point labeling. would that allow me to enable and disable break points of a specific label?
If so this would solve my problem at least if I had better than an Express version?
 

Apathetic

Platinum Member
Dec 23, 2002
2,587
6
81
I was going to recommend researching conditional breakpoints, but it looks like those aren't supported under Express either.

linky

Dave
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I was going to recommend researching conditional breakpoints, but it looks like those aren't supported under Express either.

linky

Dave

Thanks, I am quickly getting annoyed with MS with limiting express so much. I know express is free, but I would expect good debugging options.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Using less breakpoints and more ASSERT()s might help. Asserts are enabled all the time but only stop execution if the unexpected state is true.

assert( number_of_cats >= 0 && number_of_cats < 100 ) ; // crazy cat lady!
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Build conditional statements that you can control entry into. Then put a breakpoint inside the conditional do nothing block