Bug 13675 - Debugging symbols out of sync and breakpoints do not work
Summary: Debugging symbols out of sync and breakpoints do not work
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Debugger ()
Version: 1.3.x
Hardware: PC Windows
: High major
Target Milestone: ---
Assignee: Vinicius Jarina
URL:
Depends on:
Blocks:
 
Reported: 2013-08-01 02:32 UTC by Pierre-Andre van Leeuwen
Modified: 2016-05-10 17:02 UTC (History)
9 users (show)

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


Attachments
mdb path screenshot (81.61 KB, image/png)
2013-11-25 21:38 UTC, ben ishiyama-levy
Details
xamarin vs version (74.19 KB, image/png)
2013-11-25 21:38 UTC, ben ishiyama-levy
Details
breakpoint tooltip (17.88 KB, image/png)
2013-11-25 21:39 UTC, ben ishiyama-levy
Details
vs error (40.86 KB, image/png)
2013-11-25 21:39 UTC, ben ishiyama-levy
Details
offending mdb file (35.41 KB, application/octet-stream)
2013-11-25 21:40 UTC, ben ishiyama-levy
Details


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 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 FIXED

Description Pierre-Andre van Leeuwen 2013-08-01 02:32:34 UTC
Since upgrading to version 1.3 of the Visual Studio package, I've not been able to do any debugging from Visual Studio.
It looks like there is a mismatch between the running symbols (on the simulator) and what Visual Studio is using.

I can set breakpoints, but they are never hit. The following is reported in the trace log:
System.ArgumentException: Cannot set breakpoint on the specified IL offset.
   at Mono.Debugger.Soft.VirtualMachine.ErrorHandler(Object sender, ErrorHandlerEventArgs args)
   at Mono.Debugger.Soft.Connection.SendReceive(CommandSet command_set, Int32 command, PacketWriter packet)
   at Mono.Debugger.Soft.Connection.EnableEvent(EventType etype, SuspendPolicy suspend_policy, List`1 mods)
   at Mono.Debugger.Soft.EventRequest.SendReq(List`1 mods)
   at Mono.Debugger.Soft.BreakpointEventRequest.Enable()
   at Mono.Debugger.Soft.VirtualMachine.SetBreakpoint(MethodMirror method, Int64 il_offset)
   at Mono.Debugging.Soft.SoftDebuggerSession.InsertBreakpoint(Breakpoint bp, BreakInfo bi)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolvePendingBreakpoint(BreakInfo bi, Location l)
   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent(Event e)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
   at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()

If an unhandled exception occurs, Visual Studio will break execution, but the stack trace will be incorrect. The functions are reported correctly, but the file name and line number is completely wrong. You also cannot inspect the values of any variables and you cannot step through the code.

Sometimes, when starting a debugging session, the following error message is displayed, causing Visual Studio to crash:
Mono.IOS.VisualStudio.MonoTouchPackage Error: 0 : [2013-08-01 08:03:16.1] Unhandled error launching soft debugger
Mono.Debugger.Soft.VMDisconnectedException: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.
   at Mono.Debugger.Soft.Connection.SendReceive(CommandSet command_set, Int32 command, PacketWriter packet)
   at Mono.Debugger.Soft.Connection.Assembly_GetType(Int64 id, String name, Boolean ignoreCase)
   at Mono.Debugger.Soft.AssemblyMirror.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent(Event e)
   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
   at Mono.Debugging.Soft.SoftDebuggerSession.ConnectionStarted(VirtualMachine vm)
   at Mono.Debugging.Soft.SoftDebuggerSession.<>c__DisplayClass9.<StartConnecting>b__8(IAsyncResult ar)
Comment 1 Vinicius Jarina 2013-08-02 13:58:37 UTC
Hi Pierre.

What is the Xamarin.iOS version on your Mac.

Did you synced your Assemblies with your Mac? 

Try to Clean, and Rebuild your App with the Mac updated. 

:)
Comment 2 Pierre-Andre van Leeuwen 2013-08-05 00:58:16 UTC
Hi
Xamarin.iOS version on the Mac is 6.4.0.2.

I'm not sure what you mean by syncing the assemblies. How do I do that?
Visual Studio did prompt me to update the SDK after the first connection to the Mac.

I did reinstall Xamarin Studio and Xamarin.iOS on the Mac and Windows workstations, but it did not help.

We have 3 Mac/Windows installations in the office and all of them have exactly the same problem. All running Visual Studio 2012, Update 3 and the latest stable version of Xamarin.iOS.
Comment 3 Pierre-Andre van Leeuwen 2013-08-08 09:36:08 UTC
Hi

I think I've narrowed it down somewhat. I opened the solution in Xamarin Studio on the Mac and noticed that the MDB file for the exe is not copied to the output. 

Please see this thread for my findings: http://forums.xamarin.com/discussion/6841/mtouch-not-copying-mdb#latest
Comment 4 Alan McGovern 2013-11-14 12:13:41 UTC
Yes, was a known issue which has been fixed in the MonoTouch 7.x series. It may be in more recent 6.x releases, but I am unsure exactly which build might have been the first one to contain the fix.
Comment 5 ben ishiyama-levy 2013-11-25 21:38:11 UTC
Created attachment 5533 [details]
mdb path screenshot
Comment 6 ben ishiyama-levy 2013-11-25 21:38:37 UTC
Created attachment 5534 [details]
xamarin vs version
Comment 7 ben ishiyama-levy 2013-11-25 21:39:06 UTC
Created attachment 5535 [details]
breakpoint tooltip
Comment 8 ben ishiyama-levy 2013-11-25 21:39:26 UTC
Created attachment 5536 [details]
vs error
Comment 9 ben ishiyama-levy 2013-11-25 21:40:06 UTC
Created attachment 5537 [details]
offending mdb file
Comment 10 ben ishiyama-levy 2013-11-25 21:41:07 UTC
HI,
 I am on xamarion ios stack 7x, and it am encountering the issue:

my xamarin studio about on mac are :
Xamarin Studio
Version 4.2.1 (build 1)
Installation UUID: d71d0dff-30c4-4823-b65a-230277181709
Runtime:
	Mono 3.2.4 ((no/294f999)
	GTK+ 2.24.20 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302040000

Xamarin.Android
Version: 4.10.1 (Business Edition)
Android SDK: /Users/ben/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		3.1 (API level 12)
		4.0 (API level 14)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

Apple Developer Tools
Xcode 5.0 (3332.22)
Build 5A1412

Xamarin.Mac
Xamarin.Mac: Not Installed

Xamarin.iOS
Version: 7.0.2.7 (Business Edition)
Hash: 57edee2
Branch: 
Build date: 2013-04-10 18:05:51-0400

Build Information
Release ID: 402010001
Git revision: 844a84fe0aa0cb5f986d4e3c4807a51487d07845
Build date: 2013-11-13 22:12:16+0000
Xamarin addins: 97e44e4863da6c479427794457637e75b3d22600

Operating System
Mac OS X 10.9.0
Darwin benjamins-MacBook-Pro.local 13.0.0 Darwin Kernel Version 13.0.0
    Thu Sep 19 22:22:27 PDT 2013
    root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64


ERROR in visual studio (vs2013 on win 8.1 x64, v 1.4.2 - not running latest xamarin ios package as got assaulted with legions of already reported issues, and the error i am reporting now is still unsolved in 1.8x) debug output is:

System.ArgumentException: Cannot set breakpoint on the specified IL offset.
   at Mono.Debugger.Soft.VirtualMachine.ErrorHandler(Object sender, ErrorHandlerEventArgs args)
   at Mono.Debugger.Soft.Connection.SendReceive(CommandSet command_set, Int32 command, PacketWriter packet)
   at Mono.Debugger.Soft.Connection.EnableEvent(EventType etype, SuspendPolicy suspend_policy, List`1 mods)
   at Mono.Debugger.Soft.EventRequest.SendReq(List`1 mods)
   at Mono.Debugger.Soft.BreakpointEventRequest.Enable()
   at Mono.Debugger.Soft.VirtualMachine.SetBreakpoint(MethodMirror method, Int64 il_offset)
   at Mono.Debugging.Soft.SoftDebuggerSession.InsertBreakpoint(Breakpoint bp, BreakInfo bi)
   at Mono.Debugging.Soft.SoftDebuggerSession.OnInsertBreakEvent(BreakEvent ev)
   at Mono.Debugging.Client.DebuggerSession.AddBreakEvent(BreakEvent be)

I checked the output for the existence of the mdb file for the offending assembly, and it is there.

I attached the assembly mdb file, along with a few screenshots.

let me know if you need further info.
also, all my team is encountering the same issue.

Thanks,

Ben
Comment 11 Vinicius Jarina 2013-11-26 11:12:20 UTC
HI Ben, can you attach a small project that replicates the issue?

And also link a screencast (using Jing http://www.techsmith.com/jing.html ) of how to repro your issue?

Thank you :)