-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
iOS: Breakpoint not hit in classes containing static fields that are initialized inline #100243
Comments
This comment was marked as outdated.
This comment was marked as outdated.
From @prollin on Sun, 24 Mar 2024 00:10:34 GMT @rolfbjarne just had a chance to confirm that this also happens in Visual Studio Professional (tested on 17.9.4 as well as 17.10.0 Preview 2.0) with a mac build host so it is not exclusive to VSCode. This problem seem to be at the core of our inability to properly debug our app on iOS (both simulator and device) since we use static classes/variables extensively. With such a simple repro case, could this be escalated? AFAIK this has been an issue since at least net8 release for us (we only were able to narrow it down to this clear repro case recently) |
From @rolfbjarne on Mon, 25 Mar 2024 17:39:33 GMT I can reproduce, and since it's happening in VS as well, I believe dotnet/runtime is probably a more correct place for this issue. |
From @rolfbjarne on Mon, 25 Mar 2024 17:39:45 GMT FWIW I can reproduce the problem. |
It looks like this is a regression. .NET 7.0.408 iOS app can still hit the breakpoint with a static field initialized inline. |
Is there any known workaround to this issue? (aside from avoiding inline statics which would require a lot of refactoring on our end) |
Not yet. My goal is to work on it tomorrow. I will let you know when I have any news. |
@rolfbjarne a possible workaround should be enable running with interpreter, but I don't know how to do it and if this is possible in the ios template. |
Add this to the project to run with the interpreter: <PropertyGroup>
<UseInterpreter>true</UseInterpreter>
</PropertyGroup> |
I can confirm that explicitely enabling the interpreter allows the breakpoint to be hit in the sample project. Regardless, we prefer to force disable Is a fix possible without having to enable |
The PR is already opened to fix it. this is only a workaround while the fix is not shipped. |
Will this be included in the next 8.0.X release? 8.0.5? |
Yes |
From @prollin on Fri, 15 Mar 2024 17:21:43 GMT
Steps to Reproduce
dotnet new iOS
AppDelegate.cs
add a new field:private static int foo = 42;
FinishedLaunching()
Expected Behavior
Breakpoint is hit
Actual Behavior
Breakpoint not hit
Environment
Visual Studio Code 1.87.2 + .NET MAUI 0.9.7 + C# Dev Kit 1.4.29
Version information
dotnet --info
```.NET SDK:
Version: 8.0.202
Commit: 25674bb2f4
Workload version: 8.0.200-manifests.a7f084b6
Runtime Environment:
OS Name: Mac OS X
OS Version: 14.1
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/8.0.202/
.NET workloads installed:
[ios]
Installation Source: SDK 8.0.200
Manifest Version: 17.2.8043/8.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.ios/17.2.8043/WorkloadManifest.json
Install Type: FileBased
[maui]
Installation Source: SDK 8.0.200
Manifest Version: 8.0.7/8.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.7/WorkloadManifest.json
Install Type: FileBased
[android]
Installation Source: SDK 8.0.200
Manifest Version: 34.0.85/8.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.android/34.0.85/WorkloadManifest.json
Install Type: FileBased
Host:
Version: 8.0.3
Architecture: arm64
Commit: 9f4b1f5
.NET SDKs installed:
8.0.202 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
x64 [/usr/local/share/dotnet/x64]
registered at [/etc/dotnet/install_location_x64]
Environment variables:
Not set
global.json file:
Not found
The text was updated successfully, but these errors were encountered: