Avoid "Program Database for Edit & Continue"

  • Thread starter Thread starter =?ISO-8859-2?Q?Mihajlo_Cvetanovi=E6?=
  • Start date Start date
?

=?ISO-8859-2?Q?Mihajlo_Cvetanovi=E6?=

Avoid "Program Database for Edit & Continue" in VC 2003!

This option made me think I'm in Twilight Zone! The code behaves as not
intended, the breakpoints in the debugger get skipped, the only positive
thing about it is that the error is repeatable.

Consider the following code snippet (it may not produce the bug, but I
can't really post mine whole project):

f(1);
if ( q )
f(2);

Ordinary person would think that f(1) will be called every time, but not
according to the debugger when certain option is chosen. Actually, f(1)
will *not* be called, but f(2) *will*. Go figure.
 
I've actually notice this happen when you have the project set to Release and
not Debug. Also at times I've needed to do a recompile of all the code before
some parts work again too.
 
D.Rowe said:
I've actually notice this happen when you have the project set to Release and
not Debug. Also at times I've needed to do a recompile of all the code before
some parts work again too.

Optimization in release mode is very agressive and can result in moving
parts of code around and deleting dead code under some source lines.
If you want reliable debugging, compile in debug mode.

--PA
 
Back
Top