{"id":8884,"date":"2015-04-29T13:59:00","date_gmt":"2015-04-29T13:59:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2015\/04\/29\/c-enc-in-visual-studio-2015\/"},"modified":"2022-08-01T00:32:35","modified_gmt":"2022-08-01T08:32:35","slug":"c-enc-in-visual-studio-2015","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/c-enc-in-visual-studio-2015\/","title":{"rendered":"C++ EnC in Visual Studio 2015"},"content":{"rendered":"<p>One of the most useful features of the Visual Studio debugger is <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/esaeyddf.aspx\">Edit and Continue (EnC)<\/a>, which works for both managed and native code (where native admittedly had some significant limitations in previous versions of Visual Studio through 2013). In this post I want to share some changes to EnC for C++ developers with Visual Studio RC, and also share our plans for VS2015 RTM.<\/p>\n<p>First let\u2019s look at the C++ EnC against x86-built targets, and then we\u2019ll look at 64 bit.<\/p>\n<h2>C++ EnC x86<\/h2>\n<p>In Visual Studio 2013 you had to explicitly turn on edit and continue for native code because enabling it causes the debugger to fall back to the legacy (VS 2010) native debug engine. This means that you had to choose whether you were able to use new features such as <a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2013\/06\/28\/using-visual-studio-2013-to-write-maintainable-native-visualizations-natvis.aspx\">natvis<\/a>, <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2013\/07\/01\/debugging-asynchronous-code-in-visual-studio-2013-call-stack-enhancements.aspx\">async call stacks<\/a>, and the <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2015\/01\/16\/diagnostic-tools-debugger-window-in-visual-studio-2015.aspx\">Diagnostic Tools window<\/a> or use edit and continue.<\/p>\n<p>So in Visual Studio 2015 RC we\u2019ve started the process of moving edit and continue support into the current debug engine so you\u2019ll no longer have to choose which features you want. It\u2019s important to note a few things about this RC release:<\/p>\n<ul>\n<li>This represents the beginning of this feature work and is very rough, but we\u2019re excited about the capability so wanted to give you the opportunity to try it<\/li>\n<li>Because this is an early preview, it is still turned off by default.<\/li>\n<li>\n<p>In support of the goal to enabled this by default once the feature is ready, we\u2019ve modified the edit and continue UI by:<\/p>\n<\/li>\n<li>\n<p>Removing the \u201cEdit and Continue\u201d sub page<\/p>\n<\/li>\n<li>Moving the options to enable it to the General debug options page<\/li>\n<li>Once the feature is ready to be enabled by default we plan to have it share a single \u201cEnable Edit and Continue\u201d option<\/li>\n<\/ul>\n<p>So if you\u2019d like to try out this early preview experience of the ability to edit and continue your code while debugging without switching debug engines you can check \u201cEnable Native Edit and Continue\u201d option under Debug -> Options.<\/p>\n<p>Please note that errors are to be expected at this point at this stage, so if you rely on x86 edit and continue and need to continue to use the stable version that falls back to our legacy debug engine, you can access this functionality by additionally checking the \u201cUse Native Compatibility Mode\u201d (so both \u201cEnable Native Edit and Continue\u201d and \u201cUse Native Compatibility Mode\u201d must be checked).<\/p>\n<p><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;padding-right: 0px;border: 0px\" title=\"clip_image001\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/04\/2500.clip_image001_thumb_58D2B3E0.png\" alt=\"clip_image001\" width=\"750\" height=\"438\" border=\"0\" \/><\/p>\n<h2>C++ EnC 64 bit<\/h2>\n<p>One of our <a href=\"http:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio\/suggestions\/4126415-x64-edit-and-continue-for-c\">top customers request is to support edit and continue when debugging x64 C++ apps<\/a>, which is not possible with Visual Studio 2013. As part of the work described in the earlier paragraph, we\u2019re pleased to share that EnC x64 support as part of the default debug engine is currently in progress. Like the x86 support in the default engine, this is an early preview experience with many known issues. However we wanted to let you know that we are working on it, and also give the brave among you an opportunity to try it out (no prizes for making things crash or not work, it is expected at this point). If besides those warnings, you still want to enable it, you need to check the \u201cEnable Native Edit and Continue\u201d checkbox (same as opting in for x86 in the default debug engine) while also leaving unchecked \u2018Native compatibility mode\u2019. This means that once you enable edit and continue with the default engine, it will be available for x86 and x64 debugging. Additionally if you are using an existing project (so not created with Visual Studio 2015 RC) you\u2019ll need to make sure it is using the \u201cVisual Studio 2015 (v140)\u201d Platform Toolset, and that the C\/C++ -> Debug Information Format is set to \u201cProgram Data for Edit and Continue (\/ZI)\u201d (versions of Visual Studio prior to 2015 defaulted to \u201cProgram Database (\/Zi)\u201d for x64 which does not support EnC).<\/p>\n<p><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;padding-right: 0px;border: 0px\" title=\"clip_image002\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/04\/7612.clip_image002_thumb_0653D3A4.png\" alt=\"clip_image002\" width=\"825\" height=\"284\" border=\"0\" \/><\/p>\n<h2>Summary<\/h2>\n<p>In summary, we plan for a single setting to enable\/disable EnC for both native and managed, and it will work for both x86 and 64 bit \u2013 a simple story we are all looking forward to. In the meantime, with VS2015 RC, we have slightly more complicated options as described above, but also the opportunity for the bleeding edge among you to try our early EnC support in the default debug engine for both x86 and x64.<\/p>\n<p>At this point if you have any comments or questions on our direction, let us know below in the comments section, through <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/zzszcehe.aspx\">Visual Studio&#8217;s Send a Smile feature<\/a>, <a href=\"https:\/\/twitter.com\/vs_debugger\">send us a tweet<\/a>, or in our <a href=\"http:\/\/social.msdn.microsoft.com\/Forums\/en-US\/vsdebug\/threads\">MSDN forum<\/a>. Although we\u2019re not yet at the point that we are taking bug reports for this functionality as we are still working through a large number of known issues while working to finish enabling the capability.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the most useful features of the Visual Studio debugger is Edit and Continue (EnC), which works for both managed and native code (where native admittedly had some significant limitations in previous versions of Visual Studio through 2013). In this post I want to share some changes to EnC for C++ developers with Visual [&hellip;]<\/p>\n","protected":false},"author":68,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,225],"tags":[],"class_list":["post-8884","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>One of the most useful features of the Visual Studio debugger is Edit and Continue (EnC), which works for both managed and native code (where native admittedly had some significant limitations in previous versions of Visual Studio through 2013). In this post I want to share some changes to EnC for C++ developers with Visual [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/8884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=8884"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/8884\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=8884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=8884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=8884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}