Bug 947 - Debugger does not connect after it has been previously connected unless app is explicitly closed
Summary: Debugger does not connect after it has been previously connected unless app i...
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 2.8 Beta 2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2011-09-20 18:58 UTC by Mike Bluestein
Modified: 2011-10-25 07:34 UTC (History)
2 users (show)

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


Attachments
simple example with a button and a label to use a s a test case (14.70 KB, application/zip)
2011-09-20 18:58 UTC, Mike Bluestein
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:
RESOLVED NOT_ON_ROADMAP

Description Mike Bluestein 2011-09-20 18:58:17 UTC
Created attachment 453 [details]
simple example with a button and a label to use a s a test case

Description of Problem:

When deploying the app on a device, the debugger connects successfully on the first attempt (nice work!). After closing the debugging session and the app, when selecting debug a second time from MonoDevelop, it prompts to launch the app on the device, but when opening the backgrounded app, the debugger never connects. However, explicitly closing the app on the device allows the debugger connection to be re-established.

Steps to reproduce the problem:

1. Open an app and set the configuration to Debug|iPhone
2. Connect the device
3. Select Debug in MonoDevelop
4. Open the app on the device when prompted and a debug session is established
5. Stop debugging
6. Close the app by pressing the home button on the device
7. Select debug again in MonoDevelop
8. Launch the app on the device


Actual Results:

The first deployment/debug works fine but the subsequent ones don't connect the debugger unless the app is explicitly shut down on the device.

Expected Results:

The debugger connect.

How often does this happen? 

Always

Additional Information:

I attached a simple test case to try this with.

Also, if I cancel the debugger in MonoDevelop it reports the following error:

System.IO.IOException: DWP Handshake failed.
  at Mono.Debugger.Soft.Connection.Connect () [0x000f9] in /private/tmp/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:1003 
  at Mono.Debugger.Soft.VirtualMachine.connect () [0x00000] in /private/tmp/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:263 
  at Mono.Debugger.Soft.VirtualMachineManager.ConnectInternal (System.Net.Sockets.Socket dbg_sock, System.Net.Sockets.Socket con_sock, System.Net.IPEndPoint dbg_ep, System.Net.IPEndPoint con_ep) [0x0008f] in /private/tmp/source/monodevelop/main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs:305
Comment 1 Rolf Bjarne Kvinge [MSFT] 2011-10-25 07:34:27 UTC
This will likely not be implemented, adding support for attaching to a process
that has already been attached, but lost the connection to MonoDevelop will
require quite massive changes for a relatively small use-case.

Note that there is another bug which makes this issue more prominent: the app
should exit when you stop debugging in step 6 (this is bug #322). If the app
actually exits when you stop debugging you should run into this issue a lot
less (only if you background the app, stop debugging in MD, restart debugging
and then re-activate the app).