BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Taking Advantage of Edit and Continue with C++ and VS2015

Taking Advantage of Edit and Continue with C++ and VS2015

This item in japanese

The long-requested ability to edit & continue (EnC) while working with 32-bit and 64-bit C++ code has been implemented by Microsoft and is enabled by default in VS2015.  VS2013 supported a rudimentary form of EnC for 32-bit code, but enabling it meant that all of the latest features were unavailable.  EnC allows developers to make changes to their code while running their program in the debugger, and then see the results of those changes when execution resumes without requiring a recompile.

Now in VS2015, EnC can be used without losing access to other features like the Diagnostic Tools window or the enhanced call stack for debugging asynchronous code.  Even better is the expansion of edit and continue for use with 64-bit code which is a new ability with VS2015.

One thing to keep in mind is that EnC is enabled by default in new projects created from a fresh install of VS2015RTM.  When that is not the case, situations can arise where the ability to use EnC is not available.  Microsoft’s Andrew B. Hall has provided some details on the configuration changes that may be needed.  According to Hall, the three steps that should be taken are:

  • The Debug Information Format needs to be set to “Program Database for Edit and Continue (/ZI)”
  • Enable Incremental Linking needs to be set to “Yes (/INCREMENTAL)”
  • Enable Native Edit and Continue needs to be enabled under Debug -> Options

The first two apply to the project’s settings and the third is under Debug | Options.  (Hall also provides screenshots to illustrate the various locations of these settings.)

Unfortunately there remain some limitations where EnC will not work as expected.  The following impact users of VS2015RTM but Hall says they will be addressed in a future update to VS2015.  First is that binaries compiled for Windows Store do not support EnC.  Similarly, binaries compiled with /DEBUG:FASTLINK are also not supported.  This same limitation applies to binaries compiled with optimizations enabled.

When editing files through EnC, VS2015 currently supports a finite number of edits before an error message will appear indicating there is no more reserved space available.  This reserved space is currently a fixed amount, but the team plans to make this configurable so that is more developer-friendly.

To take advantage of EnC with 64-bit code, the v140 toolset must be used.  Similarly to use EnC with 32-bit code, the v120 toolset must be targeted.

Rate this Article

Adoption
Style

BT