-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowing arm64 macOS to debug dotnet projects #4288
Allowing arm64 macOS to debug dotnet projects #4288
Conversation
Issue dotnet#4277 This commit removes the bit of code that was preventing the .net debugger from starting on Apple Silicon. I've added a warning message that indicates that you might see unexpected issues when running this way. This should start working once macOS 11.1 is released next week. (See dotnet/runtime#44958 for more details)
Codecov Report
@@ Coverage Diff @@
## master #4288 +/- ##
=======================================
Coverage 85.99% 85.99%
=======================================
Files 60 60
Lines 1857 1857
Branches 215 215
=======================================
Hits 1597 1597
Misses 200 200
Partials 60 60
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are definitely welcome to do this now if you like, but according to this comment this scenario will not work. So it probably makes sense for that to be resolved before this is merged.
@@ -43,6 +43,9 @@ async function checkForInvalidArchitecture(platformInformation: PlatformInformat | |||
else if (platformInformation.architecture !== "x86_64") { | |||
if (platformInformation.isWindows() && platformInformation.architecture === "x86") { | |||
eventStream.post(new DebuggerPrerequisiteWarning(`[WARNING]: x86 Windows is not currently supported by the .NET Core debugger. Debugging will not be available.`)); | |||
} else if (platformInformation.isMacOS() && platformInformation.architecture === "arm64") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't enough - the debugger will still not download. You can likely address that by adding the following to package.json:
{
"id": "Debugger",
"description": ".NET Core Debugger (macOS / x64)",
"url": "https://download.visualstudio.microsoft.com/download/pr/6f481c2a-74a8-41cc-a115-f2d059242062/96e3d82b95ff1375347fedf0f5c7d4e7/coreclr-debug-osx-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-23-8/coreclr-debug-osx-x64.zip",
"installPath": ".debugger",
"platforms": [
"darwin"
],
// Line 275 of package.json -- Add 'arm64'
"architectures": [
"x86_64",
"arm64"
],
"binaries": [
"./vsdbg-ui",
"./vsdbg"
],
"installTestPath": "./.debugger/vsdbg-ui",
"integrity": "6BAA9A20DAA71018B9912A3E2A48C52A273ADC2E70F7101C12F688F397AD16D8"
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, fixed that.
Yeah, I've been following along with that thread. It looks like it'll let you debug and hit breakpoints, but it'll crash if you try to do a single step. So it seems like it's half-working. |
I don't have a device to play with, but I believe Jan is talking about a single step at an architectural level (setting the single step flag on the processor), which it probably used for way more than just stepping. My guess is that it is more like 99.9% broken then half working :) |
To make sure, with these changes were you able to confirm that with these changes the debugger is successfully download and you can at least use 'Start Without Debugging' on the target app? |
Could you point me to how I could get tests to run with the Apple Silicon build of VS code? It's currently only on the 1.53.0-exploration build. I'm not that familiar with how the test framework works for VS extensions. |
@arthurlockman I believe you can just test this manually.
|
@gregg-miskelly alright, got it working. The debugger successfully installs with the warning I put in: |
Thanks for doing this! I will merge this once the CI completes. |
No problem! Glad I could help! |
@@ -273,7 +273,8 @@ | |||
"darwin" | |||
], | |||
"architectures": [ | |||
"x86_64" | |||
"x86_64", | |||
"arm64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arthurlockman @gregg-miskelly do you have some context why -x64.zip
is installed for arm64
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to debug x64 processes on an M1
Issue #4277
This commit removes the bit of code that was preventing the .net debugger from starting on Apple Silicon.
I've added a warning message that indicates that you might see unexpected issues when running this way.
This should start working once macOS 11.1 is released next week. (See dotnet/runtime#44958 for more details)