Bug 41836 - [Cycle 7] Breakpoints in `async` methods in PCL projects are not hit if the linker is enabled when debugging iOS projects
Summary: [Cycle 7] Breakpoints in `async` methods in PCL projects are not hit if the l...
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools (show other bugs)
Version: XI 9.8 (tvOS / C7)
Hardware: PC Windows
: High major
Target Milestone: C7SR1
Assignee: Bugzilla
URL:
: 39257 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-15 00:19 UTC by Brendan Zagaeski (Xamarin Support)
Modified: 2017-04-06 20:18 UTC (History)
17 users (show)

See Also:
Tags: BZRC7S1_C6SR4S1, DefectEscapeReview_Done
Is this bug a regression?: Yes
Last known good build: Cycle 6 – Service Release 4


Attachments
Test case (22.07 KB, application/zip)
2016-06-15 00:19 UTC, Brendan Zagaeski (Xamarin Support)
Details

Description Brendan Zagaeski (Xamarin Support) 2016-06-15 00:19:10 UTC
Created attachment 16334 [details]
Test case

[Cycle 7] Breakpoints in `async` methods in PCL projects are not hit if the linker is enabled when debugging iOS projects




## Partial temporary workaround

Set "Project Properties > iOS Build > Linker behavior" to "Don't link".

Note: For device builds this creates significantly larger `.app` bundles and can lengthen deployment time.




## Regression status: regression in Cycle 7

BAD:  XamarinVS 4.1.0.530 (2e39740) + Xamarin.iOS 9.8.0.323 (39ebb77)
GOOD: XamarinVS 4.0.4.4   (a9c7826) + Xamarin.iOS 9.6.2.4   (d8bedd0)


Important: If I take the app built by XamarinVS 4.1 and debug it _unchanged_ (without rebuilding) on XamarinVS 4.0, it hits the breakpoint _successfully_.  Is it possible the IDE debugger integration in XamarinVS 4.1 is misreading the `.mdb` file somehow?




## Steps to replicate

1. Open the attached test case in Visual Studio.


2. Ensure that a breakpoint is set in "PortableClassLibrary1\Class1.cs" on line 14:

> int breakpointNeverHitHere = 0;

3. Select a simulator or device to set the current configuration to "Debug|iPhoneSimulator" or "Debug|iPhone".


4. Ensure that "Project Properties > iOS Build > Linker behavior" is set to "Link SDK assemblies only" in the current configuration.


5. Start debugging.




## BAD Results (Cycle 7)

- The Visual Studio debugger never breaks on the breakpoint.

- The "Debug" output does _not_ show any messages about "Resolved pending breakpoint".




## GOOD Results (Cycle 6 SR 4)

- The Visual Studio debugger _does_ break on the breakpoint.

- The "Debug" output shows:
> Resolved pending breakpoint at 'Class1.cs:14,1' to void PortableClassLibrary1.Class1.<Test>d__0.MoveNext () [0x00080].




## Additional notes on the scope of the issue

Based on brief additional testing with this minimal sample:

- It is not necessary to use the `await` keyword to see the problem.  If you remove the `async` keyword from `ViewController.cs` and remove the `await Task.Delay(10);` line from `Class1.cs`, the problem still happens.

- The `async` keyword in `Class1.cs` is _required_ to see the problem.

- The problem affects both static and non-static methods.

- The problem is limited to PCL projects: it does _not_ affect Xamarin.iOS library projects.

- The problem does not affect Xamarin Studio on Mac.




## Additional version info (brief)

Visual Studio 2013 Update 3
Windows 8.1 (64-bit)

OS X 10.11.5
Xcode 7.3, Build version 7D175
Mono 4.4.0 (5995f74)
Comment 1 Brendan Zagaeski (Xamarin Support) 2016-06-15 00:21:30 UTC
*** Bug 39257 has been marked as a duplicate of this bug. ***
Comment 15 Saurabh 2016-07-08 06:40:57 UTC
I have checked this Issue with latest Cycle 7 build (XVS 4.1.0.566). Breakpoint getting hit successfully in attached sample. This is the screencast for the same: http://www.screencast.com/t/Jl5tpjo6

Microsoft Visual Studio Professional 2013
Version 12.0.40629.00 Update 5
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0446016-02367
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06177-004-0446016-02367
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0446016-02367
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0446016-02367
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0446016-02367
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0446016-02367
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0446016-02367
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06177-004-0446016-02367
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.5.60612.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Web Apps
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.30612.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.4
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Hyper-V Android Emulator Launch   1.0
Adds a menu and toolbar items to start the VS 2015 Android emulator on VS 2013

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   2.8.60610.756
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.41012.0
Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   4.1.0.566 (2728ac0)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.1.2.0 (a7c4ebd)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   9.8.0.319 (7b89851)
Visual Studio extension to enable development for Xamarin.iOS.

Mac 10.11.5
Xcode 7.3
XI 9.8.2.13
Comment 16 Luis Aguilera 2016-07-20 22:04:59 UTC
*** Bug 42359 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.