Skip to content

[iOS] Cannot set breakpoint on the specified IL offset. #21758

@MartinZikmund

Description

@MartinZikmund

Apple platform

iOS

Framework version

net8.0-, net9.0-

Affected platform version

VS 2022 17.12.x

Description

I am hitting Cannot set breakpoint on the specified IL offset. error trying to launch the Uno Platform Sample application on iOS via Remote Mac connection from VS. The app deploys correctly to the device/Simulator, but on launch it immediately crashes when the debugger is attached with:

2024-12-04 15:27:46.530862+0100 SamplesApp[15085:147760] warning: Unable to insert breakpoint at SamplesApp.iOS.Application:<Main> (string[]):0
Cannot set breakpoint on the specified IL offset.
System.ArgumentException: Cannot set breakpoint on the specified IL offset.
   at Mono.Debugger.Soft.VirtualMachine.ErrorHandler(Object sender, ErrorHandlerEventArgs args) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\VirtualMachine.cs:line 373
   at Mono.Debugger.Soft.Connection.SendReceive(CommandSet command_set, Int32 command, PacketWriter packet) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\Connection.cs:line 1903
   at Mono.Debugger.Soft.Connection.EnableEvent(EventType etype, SuspendPolicy suspend_policy, List`1 mods) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\Connection.cs:line 2851
   at Mono.Debugger.Soft.EventRequest.SendReq(List`1 mods) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\EventRequest.cs:line 106
   at Mono.Debugging.Soft.SoftDebuggerSession.InsertBreakpoint(Breakpoint bp, BreakInfo bi, MethodMirror method, Int32 ilOffset) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1403
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveFunctionBreakpoint(BreakInfo bi, FunctionBreakpoint bp, MethodMirror method) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 2968
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 2911
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleTypeLoadEvents(TypeLoadEvent[] events) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 2420
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1879
   at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler() in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1801

This is odd because I actually have no breakpoints set (I confirmed this by both deleting all breakpoints and then doing a full git clean -xfd on the repository). I started observing this issue in VS 17.12 Preview 2.0, but it remained ever since (originally reported at VS feedback, but I believe this is a more appropriate location for this report).

Tested with two different PCs and two different Macs.

Steps to Reproduce

  1. Clone https://github.com/unoplatform/uno
  2. In src folder rename crosstargeting_override.props.sample to crosstargeting_override.props
  3. In the crosstargeting_override.props file uncomment prop and set it to net8.0-ios
  4. Open Uno.UI-netcoremobile-only.slnf and try to run SamplesApp.netcoremobile on iOS Simulator or a device
  5. You should see a crash immediately after deploy is done

Did you find any workaround?

No

Relevant logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions