Bug 27781 - Unable to Utilize Breakpoints for New NSWindow Creation
Summary: Unable to Utilize Breakpoints for New NSWindow Creation
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Other ()
Version: Master
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Chris Hamons
Depends on:
Reported: 2015-03-09 12:30 UTC by Paul Hart
Modified: 2017-02-15 00:01 UTC (History)
3 users (show)

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:

Description Paul Hart 2015-03-09 12:30:58 UTC
After writing this post:

I was advised to come here for more help. The problem is, while working on my Mac in Xamarin to create a Xamarin.Mac app, when I create a new NSWindow, I am unable to use breakpoints. Even during the creation of the Window from the AppDelegate I see "Resolved pending breakpoint at ...". 

Here is the code I am calling:

public partial class AppDelegate : NSApplicationDelegate

  NSNavigationWindowController _navigationWindowController;
  NSViewerWindowController _viewerWindowController;

  public override void DidFinishLaunching (NSNotification notification)

    _navigationWindowController = new NSNavigationWindowController ();
    _navigationWindowController.Window.MakeKeyAndOrderFront (this);


  public void ShowViewerWindow(SongData song, bool fullScreen=false, int? setListId = null)

    InvokeOnMainThread(() => {

      if(_viewerWindowController == null) {

        _viewerWindowController = new NSViewerWindowController();

      }else if(fullScreen) {

        _viewerWindowController = new NSViewerWindowController();

      _viewerWindowController.LoadSong(song, setListId); //will not break here




} //ends app delegate

I get no break in the execution and I see the following:

Resolved pending breakpoint at '.../Mac/Code/AppDelegate.cs:53,1' to void Company.Mac.AppDelegate.ShowViewerWindow (Company.Core.SongData song, bool fullScreen, int? setListId) [0x00023].
Resolved pending breakpoint at '.../Mac/Code/AppDelegate.cs:53,1' to void Company.Mac.AppDelegate.<ShowViewerWindow>c__AnonStorey0.<>m__0 () [0x00000].
Resolved pending breakpoint at '.../Mac/Code/AppDelegate.cs:54,1' to void Company.Mac.AppDelegate.<ShowViewerWindow>c__AnonStorey0.<>m__0 () [0x00001].

I ran into the problem really deep in the code so I kept moving up a layer of subviews and even at the top most level, the AppDelegate, I can not use a breakpoint. I have created a published Android and iOS app and know how breakpoints and Xamarin work. I have had a problem with breakpoints in a thread, but this is insured to be on the main thread. It really handcaps my debugging abilities to not use breakpoints. Please help.
Comment 1 Rajneesh Kumar 2015-03-11 15:21:50 UTC
I tried to reproduce this issue but not able to reproduce this. Could you please provide proper steps to reproduce or attach a small sample application that reproduce this issue. That will be very helpful to reproduce this issue at our end.

Also if possible please attach the environment info,Ide logs and build output here. You can get Ide logs via: Help=>Open Log Directory=>Ide.logs (Choose with latest timestamp)
Environment Info: Xamarin Studio=>About xamarin Studio=>Show Details=>copy  information.

Comment 2 Paul Hart 2015-03-26 11:06:56 UTC
Some updated info. The window was opened using NSButton and .Activated to start the process of creating a new window. Since creating our own button object and using the MouseDown to trigger an event the bullet points seem to work again. Until I discovered this I was opening a product window manually in the app delegate to debug. It makes since, some kind of threading issue related to the built in NSButton.
Comment 3 Chris Hamons 2015-10-06 17:24:56 UTC
Since QA was unable to reproduce, and I've never seen anything like this, moving to NEEDINFO.

Could you possibly attach an example showing the issue. Debugging issues are notoriously difficult to track down otherwise.
Comment 4 Timothy Risi 2017-02-15 00:01:18 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!