Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't Edit and Continue work on the x64 CLR?

Tags:

.net

64-bit

Microsoft have explained that they won't be supporting Edit and Continue under the x64 CLR in Visual Studio 2010:

When creating a new Visual C# Console Application in VS2010 for .NET 4.0, the default target settings for the project is to target the x86 platform instead of Any CPU (MSIL) like Visual Studio 2008 does

[...]

Adding true support for EnC to the 64-bit CLR is unfortunately a large work item and other features were prioritized over this given the work around of changing the platform target to x86.

(from http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=455103)

The description on Microsoft Connect makes it appear as though 64-bit Edit and Continue is a major architectural change. My question is: what is different about x64 that makes EnC difficult?

I haven't been able to find much in the way of technical detail on the web, other than "64-bit EnC doesn't work".

like image 586
Tim Robinson Avatar asked Jun 05 '09 13:06

Tim Robinson


People also ask

How do I enable debugging in Visual Studio?

In the Visual Studio toolbar, make sure the configuration is set to Debug. To start debugging, select the profile name in the toolbar, such as <project profile name>, IIS Express, or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.

How do I disable Debug mode in Visual Studio?

To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.

How do I disable debugging in Visual Studio 2010?

Select Stop debugging from Debug menu to end a debugging session. You also can stop debugging from the processes window. In that window, right-click the executing process and select the Detach Process or Terminate Process command.


2 Answers

Edit and Continue requires that the compiler patches a running executable. This is typically done by replacing all altered functions. Obviously, the JITted versions thereof have to be discarded as well, and callers adjusted to possibly new locations.

This isn't especially difficult for x64, probably about as hard as on x86. But unlike x86, this simply hasn't been done for x64 yet. And the differences between x86 and x64 are big enough that you can't simply take the x86 EnC code and change every 4 in an 8.

like image 148
MSalters Avatar answered Oct 08 '22 23:10

MSalters


This blog post expands on what MSalters said: http://blogs.msdn.com/rmbyers/archive/2009/06/08/anycpu-exes-are-usually-more-trouble-then-they-re-worth.aspx

Basically, Microsoft is more interested in improving the x86 debugging tools (e.g. Intellitrace) than it is in improving the x64 debugging tools. This is quite worrying since it seems like Intellitrace will also have to be ported to x64 at some point, which will likely further delay improvements to x64 debugging.

like image 20
Eric Avatar answered Oct 08 '22 22:10

Eric