1

If I create a new win32 C++ project in VS2008 I can use Edit & Continue with it just fine, but with this legacy project I'm working with my attempts to use / enable it have failed.

Here are things I've checked:

Tools -> Options -> Debugging -> Edit and Continue -> Enable Edit and Continue is ON.

Debug Information Format: Program Database (/Zi)

Code Generation -> Enable Function-Level Linking: Yes (/Gy)

Looked for a corrupt .ILK file. I can't find any .ILK files - are they still used in 2008?

But when I step into the program, change the next line, and step again, I get:

"This source file has changed. It no longer matches..."

rather than

"Would you like Edit & Continue to apply your code changes."

What's wrong with this project that E&C doesn't work?

fretje
  • 8,322
  • 2
  • 49
  • 61
Jamie Fristrom
  • 341
  • 4
  • 11

2 Answers2

0

I assume you have debugging symbols/etc and the legacy C++ application had been compiled with this support...

If not, then you will run into the problem that the code was not 'instrumented' to allow for injection of alternate code.

I would suspect that the changes in output code format would make VC++ 2008 incompatible... as I doubt Microsoft added such backwards compatibility in (until VS 2008, I think they even made it hard to use older versions of .Net without using the specific VS)

harningt
  • 709
  • 7
  • 19
  • 1
    Pretty sure that's what "Debug Information Format: Program Database" is. The project has been 2008ified, fwiw, using Microsoft's automatic upgrading facility. – Jamie Fristrom Jul 18 '09 at 21:17
0

This messagebox

This source file has changed. It no longer matches the version of the file used to build the application being debugged.

seems only to be appearing when I made a code change on the exact line where the breakpoint is.

I've found that I can just click the OK button. And when I then press F10 to actually execute the line that has changed, "Edit and Continue" kicks in and recompiles the code.

After that, the breakpoint is disabled though (it shows a yellow triangle with an exclamation mark):

disabled breakpoint

To re-enable it, you can just right-click the breakpoint and choose "Location...":

right click breakpoint

which brings you to this dialog:

breakpoint location dialog:

where you need to check the "Allow the source code to be different from the original version" checkbox. Click OK and your breakpoint will be enabled again.

fretje
  • 8,322
  • 2
  • 49
  • 61