{"id":9545,"date":"2016-07-01T18:47:50","date_gmt":"2016-07-02T01:47:50","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=9545"},"modified":"2020-01-23T18:35:05","modified_gmt":"2020-01-23T18:35:05","slug":"c-edit-and-continue-in-visual-studio-2015-update-3","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/c-edit-and-continue-in-visual-studio-2015-update-3\/","title":{"rendered":"C++ Edit and Continue in Visual Studio 2015 Update 3"},"content":{"rendered":"<p>We\u2019ve been continuing to improve on <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2015\/07\/22\/c-edit-and-continue-in-visual-studio-2015\/\">C++ Edit and Continue (EnC) since we shipped it in Visual Studio 2015 <\/a>with the default debug engine and the VC 140 toolset. We\u2019ve addressed a fair bit of customer feedback and based on this, I\u2019ll go over the latest developments in C++ EnC for Update 3 (<a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=691129\">download<\/a>)\u00a0and other clarifications in this blog post.<\/p>\n<p>A quick recap &#8211; Edit and Continue allows you to modify your code while debugging (for example, if you happened to find a bug in your code at runtime), and the debugger will apply your code changes to the debugged process and continue debugging with your new code! This can help speed up your Edit &gt; Build &gt; Deploy &gt; Debug cycle. Find out more info with our previous posts\u00a0<a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2015\/07\/22\/c-edit-and-continue-in-visual-studio-2015\/\">here<\/a> and <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/improvements-for-c-edit-and-continue-in-visual-studio-2015-update-1\/\">here<\/a> on how to use C++ Edit and Continue.<\/p>\n<h2>Things we fixed in Update 3<\/h2>\n<p><!--more--><\/p>\n<ul>\n<li><strong>Stale code (false positive) with EnC on static libraries: <\/strong>Making edits to source files in static libraries resulted in mismatching source information and stale code with a misleading solitary \u201cSuccessfully applied code changes.\u201d message. This issue has been fixed and now any stale code situation should include a warning explaining why we couldn\u2019t remap the Instruction Pointer.<\/li>\n<\/ul>\n<div><\/div>\n<ul>\n<li><strong>EnC Crashes\/Hangs for large projects linked with \/DEBUG:FASTLINK debug information: <\/strong>Since the linker switch FASTLINK leaves debug information in the obj files rather than consolidating it in the PDB, Visual Studio was running into memory issues with EnC on large projects, which is now resolved.<\/li>\n<\/ul>\n<div><\/div>\n<ul>\n<li><strong>C1092 error\/C4656 warning:<\/strong> We\u2019ve fixed more reports of the infamous <em>\u201cfatal error C1092: Edit and Continue does not support changes to data types; build required\u201d<\/em> error for unrelated changes. Also, the compiler will not emit <em>\u201cwarning C4656: \u2026 data type is new or has changed since the latest build, or is defined differently elsewhere\u201d<\/em> for false positive cases which caused compilation errors during EnC if you originally built with \/WX (treat all warnings as errors).<\/li>\n<\/ul>\n<div><\/div>\n<ul>\n<li><strong>Improved performance of \u201cApplying code changes\u2026\u201d in EnC:<\/strong> We\u2019ve chipped away at the time to apply code changes (i.e., when you see the dialog that says \u201cApplying code changes\u2026\u201d) and made it ~3x faster!<strong>\u00a0<\/strong><\/li>\n<\/ul>\n<h2>Breaking Changes with Update 3<\/h2>\n<ul>\n<li><strong>Allow Precompiling (Native only): The debug option Debug &gt; Options &gt; General &gt; Allow Precompiling (Native only) is no longer supported with Visual Studio 2015 Update 3 and the default debugger.<\/strong> This is a legacy setting for a marginal performance improvement that has no functional impact.<\/li>\n<\/ul>\n<h2>Quick EnC reference<\/h2>\n<h2>Requirements for C++ Edit and Continue<\/h2>\n<ul>\n<li><strong>Build settings (project properties):<\/strong>\n<ol>\n<li>C\/C++ &gt; General &gt; Debug Information Format: Program Database for Edit and Continue (\/ZI)<\/li>\n<li>C\/C++ &gt; Code Generation &gt; Enable Minimal Rebuild: Yes (\/Gm)<\/li>\n<li>Linker &gt; General &gt; Enable Incremental Linking: Yes (\/INCREMENTAL)<\/li>\n<\/ol>\n<p>Any incompatible linker settings (such as \/SAFESEH, or \/OPT:\u2026) should cause warning LNK4075 during build (for example, <em>\u201cignoring \u2018\/EDITANDCONTINUE\u2019 due to \u2018\/OPT:ICF\u2019 specification\u201d<\/em>).<\/li>\n<\/ul>\n<ul>\n<li><strong>Debugger settings (Debug &gt; Options &gt; General):<\/strong>\n<ol>\n<li>Enable Native Edit and Continue<\/li>\n<\/ol>\n<p>Any incompatible compiler or linker settings will cause an error during Edit and Continue (for example, <em>\u201c&#8217;file.cpp&#8217; in &#8216;MyApp.dll&#8217; was not linked with Edit and Continue enabled. Ensure that \/INCREMENTAL linking is enabled, and the \/EDITANDCONTINUE directive is not ignored.\u201d<\/em>)<\/li>\n<\/ul>\n<h2>Incompatible settings and unsupported scenarios<\/h2>\n<ul>\n<li><strong>Debugger settings (Debug &gt; Options &gt; General):<\/strong>\n<ol>\n<li>\u201cRequire source files to exactly match the original version\u201d: Having this option unchecked causes incorrect breakpoint binding after EnC in the modified functions, and so with Update 3 applying changes with this option unchecked will cause the error <em>\u201cThe &#8216;Require source files to exactly match the original version&#8217; setting under Debug-&gt;Options-&gt;General needs to be enabled for Edit and Continue. Please check this option and try again.\u201d<\/em><\/li>\n<li><strong>\u201cAllow precompiling (Native only)\u201d: This option is no longer supported with Visual Studio\u00a0 2015 Update 3 with the default debugger.<\/strong><\/li>\n<\/ol>\n<\/li>\n<li><strong>Windows 8\/8.1 Store Apps:<\/strong> These projects use the VC 120 toolset and the C\/C++ \/bigobj switch. EnC with \/bigobj is only supported in the VC 140 toolset.<\/li>\n<li><strong>Modifying lambdas passed to std::function:<\/strong> This will cause a genuine ODR violation and results in C1092.<\/li>\n<li><strong>Using a custom compiler (cl.exe) path:<\/strong> For security reasons, for recompilation of a file during EnC, Visual Studio will always use the installed compiler. If you are using a custom compiler path (for example through a custom $(ExecutablePath) variable in your *.props file), a warning will be displayed and VS will fall back to using the installed compiler of the same version\/architecture.<\/li>\n<li><strong>FASTBuild build system:<\/strong> FASTBuild is not currently compatible with the \u201cEnable Minimal Rebuild (\/Gm)\u201d compiler switch and so Edit and Continue is not supported.<\/li>\n<li><strong>Architectures\/VC Toolsets: <\/strong>With the VC 140 toolset, the default debugger supports Edit and Continue\u00a0with both X86 and X64 applications. Legacy toolsets support only X86 applications. Toolsets older than VC 120 should use the legacy debugger by checking Debug &gt; Options &gt; General &gt; Use Native Compatibility Mode, to use Edit and Continue.<\/li>\n<\/ul>\n<h2>Logging<\/h2>\n<p>A frequent question we\u2019ve received is about enabling logging if users run into issues with EnC. To help diagnose EnC issues, you can set the following DWORD registry value:<\/p>\n<ul>\n<li>Visual Studio 2015: HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\VisualStudio\\14.0_Config\\Debugger\\NativeEncDiagnosticLoggingLevel = 1<\/li>\n<li>Visual Studio 2017 or newer: From a Developer command prompt, run VsRegEdit.exe set &#8220;C:\\Program Files (x86)\\Microsoft Visual Studio\\[Version]\\[YOUR EDITION]&#8221; HKCU Debugger NativeEncDiagnosticLoggingLevel DWORD 1<\/li>\n<\/ul>\n<p>Setting this value\u00a0(at the start of a debug session) will cause the various components of EnC to spew verbose logging to the Output &gt; Debug pane.<\/p>\n<h2>Summary<\/h2>\n<p>We\u2019d love to hear any feedback on Edit and Continue \u2013 you can reach us at vsdbgfb at microsoft dot com\/in the comments below\/<a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/b8akas30.aspx\">through the Send Feedback feature in Visual Studio<\/a>\/via <a href=\"https:\/\/twitter.com\/vs_debugger\">twitter<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019ve been continuing to improve on C++ Edit and Continue (EnC) since we shipped it in Visual Studio 2015 with the default debug engine and the VC 140 toolset. We\u2019ve addressed a fair bit of customer feedback and based on this, I\u2019ll go over the latest developments in C++ EnC for Update 3 (download)\u00a0and other [&hellip;]<\/p>\n","protected":false},"author":315,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270],"tags":[8,140,55,194,36],"class_list":["post-9545","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","tag-announcement","tag-c","tag-debugging","tag-diagnostics","tag-vc"],"acf":[],"blog_post_summary":"<p>We\u2019ve been continuing to improve on C++ Edit and Continue (EnC) since we shipped it in Visual Studio 2015 with the default debug engine and the VC 140 toolset. We\u2019ve addressed a fair bit of customer feedback and based on this, I\u2019ll go over the latest developments in C++ EnC for Update 3 (download)\u00a0and other [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/9545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/315"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=9545"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/9545\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=9545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=9545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=9545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}