Bug 11724 - Cannot debug in Xamarin.iOS 6.2.x with iOS Device
Summary: Cannot debug in Xamarin.iOS 6.2.x with iOS Device
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: Debugger ()
Version: 6.2.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-04-11 02:45 UTC by Pang
Modified: 2013-12-05 18:34 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Pang 2013-04-11 02:45:09 UTC
Problems:
- Breakpoints were not hit.

Observation:
1. Did not occur in Simulator. Did occur iOS devices only.
  Tested devices: iPhone 4s and iPhone 5 with iOS v6.0.1

2. Did not occur in Xamarin.iOS v6.0.10. Did occur in 6.2.1.201 and v6.2.3.0.

3. It occurred in specific view controllers only with 100% occurrence rate.

4. It occurred in iOS Device debugging build only. No problem for debug build (simulator) and release builds (device and simulator)

5. Tested that the breakpoints were not hit even in ViewDidLoad, ViewWillAppear and ViewDidAppear. The view controller was shown correctly in the phone.

6. When setting breakpoint in view controller class constructor (only), the error below is shown
  "Cannot set breakpoint on the specified IL offset"
Comment 1 Pang 2013-04-11 02:46:02 UTC
For  observation #6, detail logs are shown below:

System.ArgumentException: Cannot set breakpoint on the specified IL offset.
  at Mono.Debugger.Soft.VirtualMachine.ErrorHandler (System.Object sender, Mono.Debugger.Soft.ErrorHandlerEventArgs args) [0x00069] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:299 
  at Mono.Debugger.Soft.Connection.SendReceive (CommandSet command_set, Int32 command, Mono.Debugger.Soft.PacketWriter packet) [0x000d5] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:1445 
  at Mono.Debugger.Soft.Connection.EnableEvent (EventType etype, SuspendPolicy suspend_policy, System.Collections.Generic.List`1 mods) [0x0033f] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:2194 
  at Mono.Debugger.Soft.EventRequest.SendReq (System.Collections.Generic.List`1 mods) [0x000a4] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/EventRequest.cs:106 
  at Mono.Debugger.Soft.BreakpointEventRequest.Enable () [0x00030] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/BreakpointEventRequest.cs:25 
  at Mono.Debugger.Soft.VirtualMachine.SetBreakpoint (Mono.Debugger.Soft.MethodMirror method, Int64 il_offset) [0x00009] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:240 
  at Mono.Debugging.Soft.SoftDebuggerSession.InsertBreakpoint (Mono.Debugging.Client.Breakpoint bp, Mono.Debugging.Soft.BreakInfo bi) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:896 
  at Mono.Debugging.Soft.SoftDebuggerSession.ResolvePendingBreakpoint (Mono.Debugging.Soft.BreakInfo bi, Mono.Debugger.Soft.Location l) [0x00007] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:2103 
  at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints (Mono.Debugger.Soft.TypeMirror type) [0x002e2] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1860 
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent (Mono.Debugger.Soft.Event e) [0x0034c] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1455 
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet (Mono.Debugger.Soft.EventSet es) [0x0009c] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1247 
  at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler () [0x0002d] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1178
Comment 2 Pang 2013-04-11 04:52:25 UTC
Additional information:
- Xamarin Studio v4.0.3(build 13) was used.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2013-04-23 10:17:56 UTC
Can you provide a complete project we can use to reproduce this?
Comment 4 Pang 2013-04-24 21:35:03 UTC
Sorry to inform that such problem happened in my actual development source codes only.
Hence, the source codes couldn't be disclosed.

I am unable to reproduce the problem in an independent unit test solution.
Comment 5 Pang 2013-04-24 21:55:00 UTC
Additional information #1:

(Environments)
Xamarin Studio
Version 4.0.4 (build 2)
Installation UUID: 1fa6f79e-043e-4d8f-8ede-e7b6694f1dc1
Runtime:
	Mono 2.10.12 (mono-2-10/c9b270d)
	GTK 2.24.16
	GTK# (2.12.0.0)
	Package version: 210120000

Xamarin.iOS
Version: 6.2.4.2 (Business Edition)
Hash: c4f6316
Branch: 
Build date: 2013-22-04 18:55:23-0400

(Observations)
When I tried to remove some codes to find the cause, strange things happened.
1. Before debugging run -> Put a breakpoint in ViewWillAppear of a UIViewController.
2. During debugging run -> The breakpoint was hit. => Good sign.

However, the problems are:
1. Hitting breakpoint at wrong position
- Breakpoints was set in line127 within the ViewWillAppear function.
- However, debugger hit the breakpoint at line133 which was the closing brace  of that function.

2. Sometimes, error message was shown directly without breakpoint being hit:

System.ArgumentException: Cannot set breakpoint on the specified IL offset.
  at Mono.Debugger.Soft.VirtualMachine.ErrorHandler (System.Object sender, Mono.Debugger.Soft.ErrorHandlerEventArgs args) [0x00069] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:299 
  at Mono.Debugger.Soft.Connection.SendReceive (CommandSet command_set, Int32 command, Mono.Debugger.Soft.PacketWriter packet) [0x000d5] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:1445 
  at Mono.Debugger.Soft.Connection.EnableEvent (EventType etype, SuspendPolicy suspend_policy, System.Collections.Generic.List`1 mods) [0x0033f] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:2194 
  at Mono.Debugger.Soft.EventRequest.SendReq (System.Collections.Generic.List`1 mods) [0x000a4] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/EventRequest.cs:106 
  at Mono.Debugger.Soft.BreakpointEventRequest.Enable () [0x00030] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/BreakpointEventRequest.cs:25 
  at Mono.Debugger.Soft.VirtualMachine.SetBreakpoint (Mono.Debugger.Soft.MethodMirror method, Int64 il_offset) [0x00009] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:240 
  at Mono.Debugging.Soft.SoftDebuggerSession.InsertBreakpoint (Mono.Debugging.Client.Breakpoint bp, Mono.Debugging.Soft.BreakInfo bi) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:896 
  at Mono.Debugging.Soft.SoftDebuggerSession.ResolvePendingBreakpoint (Mono.Debugging.Soft.BreakInfo bi, Mono.Debugger.Soft.Location l) [0x00007] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:2103 
  at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints (Mono.Debugger.Soft.TypeMirror type) [0x002e2] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1860 
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent (Mono.Debugger.Soft.Event e) [0x0034c] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1455 
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet (Mono.Debugger.Soft.EventSet es) [0x0009c] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1247 
  at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler () [0x0002d] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:1178 


3. Error message was shown after I put another breakpoint.
- After the problem #1, breakpoint was hit at line133. I tried to put another breakpoint anywhere within the ViewWillAppear function.
- Error message was shown as below. It was shown if breakpoint was set in the constructor or ViewWillAppear. It was not shown if I tried to set the breakpoint in other functions (ViewDidAppear, ViewDidLoad and custom functions)

System.ArgumentException: Cannot set breakpoint on the specified IL offset.
  at Mono.Debugger.Soft.VirtualMachine.ErrorHandler (System.Object sender, Mono.Debugger.Soft.ErrorHandlerEventArgs args) [0x00069] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:299 
  at Mono.Debugger.Soft.Connection.SendReceive (CommandSet command_set, Int32 command, Mono.Debugger.Soft.PacketWriter packet) [0x000d5] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:1445 
  at Mono.Debugger.Soft.Connection.EnableEvent (EventType etype, SuspendPolicy suspend_policy, System.Collections.Generic.List`1 mods) [0x0033f] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:2194 
  at Mono.Debugger.Soft.EventRequest.SendReq (System.Collections.Generic.List`1 mods) [0x000a4] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/EventRequest.cs:106 
  at Mono.Debugger.Soft.BreakpointEventRequest.Enable () [0x00030] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/BreakpointEventRequest.cs:25 
  at Mono.Debugger.Soft.VirtualMachine.SetBreakpoint (Mono.Debugger.Soft.MethodMirror method, Int64 il_offset) [0x00009] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:240 
  at Mono.Debugging.Soft.SoftDebuggerSession.InsertBreakpoint (Mono.Debugging.Client.Breakpoint bp, Mono.Debugging.Soft.BreakInfo bi) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:896 
  at Mono.Debugging.Soft.SoftDebuggerSession.OnInsertBreakEvent (Mono.Debugging.Client.BreakEvent ev) [0x00141] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/SoftDebuggerSession.cs:774 
  at Mono.Debugging.Client.DebuggerSession.AddBreakEvent (Mono.Debugging.Client.BreakEvent be) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-evolve_fixed/a8bf58d3/source/monodevelop/main/src/core/Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs:542
Comment 6 Pang 2013-04-24 21:58:38 UTC
Additional information #2:

All these problems did not happen in Xamarin.iOS v6.0.10.
They happened in all v6.2.x stable releases (6.2.1.20, v6.2.3.0 and 6.2.4.2) that I have used.

Perhaps, you could review the changes made between these versions.
Comment 8 PJ 2013-11-19 17:04:33 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 9 PJ 2013-12-05 18:34:39 UTC
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.

Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.