Bug 17512 - Breakpoint in Android library project not hit when disable fastdebug and linking sdk assemblies only
Summary: Breakpoint in Android library project not hit when disable fastdebug and link...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Debugger ()
Version: 4.10.0.x
Hardware: Macintosh Windows
: Normal normal
Target Milestone: 6.1 (C7)
Assignee: dean.ellis
URL:
: 32371 ()
Depends on:
Blocks:
 
Reported: 2014-01-30 10:58 UTC by leankitryan
Modified: 2016-06-03 15:11 UTC (History)
7 users (show)

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


Attachments
Sample test project (37.48 KB, application/zip)
2014-02-03 09:57 UTC, Sadik Ali
Details
Edited previous solution demonstrating the issue (30.25 KB, application/x-zip-compressed)
2014-02-04 14:40 UTC, leankitryan
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 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:
VERIFIED FIXED

Description leankitryan 2014-01-30 10:58:48 UTC
Almost exactly the same issue as https://bugzilla.xamarin.com/show_bug.cgi?id=9433 except only occurring in referenced assemblies.

Solution contains two projects - Android Library project and one Android project. When debugging with Linking in the Android project properties set to "Sdk Assemblies Only" and "Use Fast Deployment" unchecked, breakpoints in the Android project are hit however breakpoints in the referenced Android library project are not hit. If linking is changed to "None", breakpoints in both projects are hit.

Able to reproduce on multiple developer workstations with our solution. 
Able to reproduce in both Visual Studio and Xamarin Studio. 
Able to reproduce on both emulators and physical devices.

Note - in trying to reproduce this issue in a test solution, the problem did not present itself until the referenced library project's DLL exceeded a size of ~17kb. With only small class added to the referenced project at around ~14kb, breakpoints were still hit. Once multiple classes were added to the second project for a size around ~17kb, no breakpoints were hit in the library project.
Comment 1 Sadik Ali 2014-02-03 07:49:18 UTC
I am unable to reproduce this issue. Following are the checked steps:

1. Created a Android project and android library project.
2. Added some classes in Android library project to increase size 17 kb
3. Set linking option to "Sdk Assemblies Only" and "Use Fast Deployment" unchecked
4. Deployed application on real device, emulator and added breakpoints in library project.
5. Debug android application.
6. observed that break point always hit.

Refer screen cast: http://screencast.com/t/Xcr891nDYf1

Checked With

Mac, Window
XS 4.2.3 (Build 53)
XA 4.12.0.14 (Mac), 4.13.0.56(Windows)

I have checked in created project into Git repository "QualityAssurance" under folder "Samples/android/Bug17512" 

I have also tried to check this on VS but application is not opening due to compatibility issue. An issue "Bug 17566" is reported for the same.

please try this with the help of project and let me know if missing anything.
Comment 2 leankitryan 2014-02-03 09:18:34 UTC
Where might I find that Git repository "QualityAssurance"?

Without trying your test project I will say I immediately noticed the XA version you have indicated does not match the version I indicated in the bug. 

Xamarin.Android 4.10.01073 (d23a19bf)
Xamarin Studio Version 4.2.2 (build 2)
Comment 3 Sadik Ali 2014-02-03 09:57:48 UTC
Created attachment 5961 [details]
Sample test project

check this on below environments and unable to reproduce:

Mac
Xamarin.Android 4.10.1.68
Xamarin Studio Version 4.2.2 (build 2)

On window with Xamarin.Android 4.10.01073 (d23a19bf) VS application is not opening, issue "Bug 17566" is reported for the same.

Attached sample test project
Comment 4 leankitryan 2014-02-04 14:40:13 UTC
Created attachment 5972 [details]
Edited previous solution demonstrating the issue

I was able to modify your solution to demonstrate the problem. The missing factor was the library methods needed to be async. See the attachment. Place a breakpoint in the async library PrintTableData method of FirstClass where indicated by my comment. With Linker set to "Don't link", the breakpoint is hit. With Linker set to "SDK Assemblies Only", the breakpoint is not hit.
Comment 5 Sadik Ali 2014-02-05 02:21:13 UTC
I am able to reproduce this issue on below environments

All Mac 
XS 4.2.2 (Build 2), 4.2.3 (Build 53)
XA 4.10.1, 4.12.0.14 (Mac), 4.10.0.1-73(Windows)


Refer screen cast: http://screencast.com/t/aPE9Qdj7MYp
Comment 6 Peter Collins 2015-08-18 13:46:32 UTC
*** Bug 32371 has been marked as a duplicate of this bug. ***
Comment 7 dean.ellis 2016-01-22 10:50:19 UTC
I am unable to replicate this on the latest master builds, the break points work perfectly in the position suggested in the bug and any other place in the library project.  Can QA confirm that this is fixed in master please.
Comment 8 Peter Collins 2016-01-22 17:12:09 UTC
I'm also unable to reproduce this behavior using the attached project. @Sadik can you take a look at this on Windows and confirm that this is no longer reproducible in both XS and VS?
Comment 9 Abhishek 2016-06-03 15:11:14 UTC
I have checked this issue with latest C7 build both on Mac and Windows XS and VS.

xamarin.android-6.1.0-71_4e275588a9819661d9e04b3d3b96db8fa6996816
XamarinStudio-6.0.0.5173_f38351499295aec588bce77845f5886ec7b8634e
Xamarin.VisualStudio_4.1.0.530_63d15ded92ea1537332587d60dd47f0ad3fde434. I have followed the bug description. Now I am able to hit the break point after unchecked Fast deployment and set Linker to "Sdk Assemblies Only". breakpoint hit successfully on Android Library project.

Screencast for Mac XS: http://www.screencast.com/t/tNxPLd9q4CvD
Screencast for Windows VS: http://www.screencast.com/t/AhC0F5NvZ
Screencast for Windows XS: http://www.screencast.com/t/EKS7PVjmSi42

Hence closing this issue.

Thanks!