Bug 38241 - Android.OS.Debug.IsDebuggerConnected returns false when Xamarin/Mono debugger is attached
Summary: Android.OS.Debug.IsDebuggerConnected returns false when Xamarin/Mono debugger...
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2016-02-01 10:07 UTC by Ian Newson
Modified: 2017-06-27 05:39 UTC (History)
2 users (show)

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

Picture showing debugger being indicated not attached (7.09 KB, image/png)
2016-02-01 10:07 UTC, Ian Newson

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 Ian Newson 2016-02-01 10:07:11 UTC
Created attachment 14825 [details]
Picture showing debugger being indicated not attached

Android.OS.Debug.IsDebuggerConnected returns false even though the Xamarin/Mono debugger is attached. This is confusing and counter intuitive, and isn't mentioned in the documentation.

Can this method either be fixed, or can the documentation be updated to reflect the true nature of the property please?

I also posted this on StackOverflow: http://stackoverflow.com/questions/35090054/xamarin-isdebuggerconnected-returns-incorrect-value
Comment 1 Jonathan Pryor 2016-02-04 20:16:29 UTC
A (the?) problem is that there are *at least three* possible debuggers running around, and none know about the others:

1. The Java debugger, which is what android.os.Debug.isDebuggerConnected() knows about.

2. The Mono debugger (sdb), which System.Diagnostics.Debugger.IsAttached knows about.

3. gdb or any other native debugger (such as lldb), which *nothing* knows about.

We do not plan on updating Android.OS.Debug.IsDebuggerConnected to be aware of the mono debugger.

We will look into updating the documentation.