what does it mean? Require source files to exactly

2019-06-15 01:12发布

this debugging option: Require source files to exactly match the original version

This is from MSDN:

Tells the debugger to verify that a source file matches the version of the source code used to build the executable you are debugging. If the version does not match, you will be prompted to find matching source. If matching source is not found, the source code will not be displayed during debugging.

But still I do not understand it! So is it better to select it or unselect it?

4条回答
ゆ 、 Hurt°
2楼-- · 2019-06-15 01:39

I would leave the option selected.

Consider the following situation:

  • Build some code
  • Make a change to a source file
  • Start debugging

Now when you are debugging, the source file no longer matches what was used during compilation. This might leave you with breakpoints or line numbers that no longer match what's actually happening in the debugger.

If there is some reason why you want to see your local code instead, deselect the option.

查看更多
地球回转人心会变
3楼-- · 2019-06-15 01:43

Situation: You have loaded in your editor a version of a file which is different than the one compiled into the executable you are debugging.

If the option is selected, and you try to debug code in that file, you will be prompted to find the right one, or else you will not be able to step into or break on any of that file's functions. (I think the pop-up dialog also allows you to select "use this version anyway").

If the option is not selected, you will see your version of the file. However, the code you see may be very different from the code that is executing. The breakpoint will be displayed on the line number matching the old file. It may show up in a blank line, or a comment, or some other function entirely.

In general, you should select it, so that you know that what you are seeing is what you are running.

查看更多
祖国的老花朵
4楼-- · 2019-06-15 01:44

To change this please do as follows :

Tools -> Options -> Debugging -> Require source files to exactly match the original version

You can change it from here.

Another is :

Tools -> Options -> Debugging -> Enable Edit and Continue (with all its children checked)

This option works only in debugging mode and is helpful thing

If you like the answer please Up Vote the same.

查看更多
混吃等死
5楼-- · 2019-06-15 01:49

try to rebuild the whole solution instead of just rebuild the project and keep ...this worked for me.

查看更多
登录 后发表回答