Skip to content

Debugging not working with XCode 12 selected #42311

@DavidKarlas

Description

@DavidKarlas

Description

In VSMac, we are using vsdbg(same as Omnisharp) to debug .NET Core applications... We have unit tests, but ever since bumping XCode from 11 to 12, debugging started failing... So here are repro steps:

  1. sudo xcode-select -s /Applications/Xcode_12.app
  2. mkdir xcodeTestProj
  3. cd xcodeTestProj
  4. dotnet new console
  5. dotnet publish --runtime osx-x64
  6. code .
  7. create launch.json via VSCode, and change:
  • "program": "${workspaceFolder}/bin/Debug/net5.0/xcodeTestProj.dll",
  • to
  • "program": "${workspaceFolder}/bin/Debug/net5.0/osx-x64/publish/xcodeTestProj.dll",
  1. Start debugging
  2. Observe Debug Console print Unable to attach to CoreCLR. Unknown Error: 0x80131c3c

Now try all steps, but change step 1 to sudo xcode-select -s /Applications/Xcode_11.app(notice change of Xcode version), it will work fine.

I tried to change to not use published version... But when tests are executing they fail either wrong variables values are reported or “Unable to evaluate expression because the code is optimized o...”.(Only when using XCode 12, fine with XCode 11). I believe underlining problem is same, hence I suggest trying debugging published app since its easier repro...

Im not sure how is selecting XCode 12 vs 11 effecting debugging of CoreCLR, but it does, I suspect its something related to lldb or some libraries used...

Configuration

  • Which version of .NET is the code running on? 3.1, but also tried with 5.0
  • What OS and version, and what distro if applicable? macOs
  • What is the architecture (x64, x86, ARM, ARM64)? x64
  • Do you know whether it is specific to that configuration? Yes(macOs)
  • If you're using Blazor, which web browser(s) do you see this issue in? N/A

Regression?

No.

Other information

We have to disable .NET Core unit tests for until this is resolved, but I also believe this will effect users when doing some complex debugging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions