1

如果我在 VS2008 中创建一个新的 win32 C++ 项目,我可以很好地使用 Edit & Continue,但是对于这个遗留项目,我正在尝试使用/启用它失败了。

以下是我检查过的内容:

工具 -> 选项 -> 调试 -> 编辑并继续 -> 启用编辑并继续为 ON。

调试信息格式:程序数据库(/Zi)

代码生成 -> 启用功能级链接:是 (/Gy)

查找损坏的 .ILK 文件。我找不到任何 .ILK 文件 - 它们在 2008 年仍在使用吗?

但是当我进入程序时,更改下一行,然后再次执行,我得到:

“此源文件已更改。它不再匹配...”

而不是

“您是否希望编辑并继续应用您的代码更改。”

这个 E&C 行不通的项目有什么问题?

4

2 回答 2

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.

于 2011-04-17T19:00:01.170 回答
0

我假设您已调试符号/等,并且已使用此支持编译了旧版 C++ 应用程序...

如果没有,那么您将遇到代码未被“检测”以允许注入备用代码的问题。

我怀疑输出代码格式的更改会使 VC++ 2008 不兼容......因为我怀疑微软在(直到 VS 2008 之前)添加了这种向后兼容性,我认为他们甚至很难在不使用特定的情况下使用旧版本的 .Net对)

于 2009-07-16T18:37:17.567 回答