Bug 13399 - Step Over behavior inconsistent in code using await Task.Run ()
Summary: Step Over behavior inconsistent in code using await Task.Run ()
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
Depends on:
Reported: 2013-07-22 20:54 UTC by Timothy Risi
Modified: 2018-01-19 16:22 UTC (History)
4 users (show)

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

Sample app (13.40 KB, application/x-zip-compressed)
2013-07-22 21:03 UTC, Timothy Risi

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 GitHub or Developer Community 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 Timothy Risi 2013-07-22 20:54:24 UTC
Case 1:

Steps to Reproduce:
1.  Set a breakpoint on line 42 of MainActivity.cs - 'await Task.Run (() => SomeLongRunningTask ());'
2.  Debug the program
3.  When the debugger breaks at the line, use Step Over

Expected Result: Debugger steps over to line 43.

Actual Result: Execution continues as if Continue Execution were used instead of Step Over (the Application Output shows the results of the Console.WriteLine calls all the way back up the chain to the completion of the delegate method called when the button is clicked).

Case 2:

Steps to reproduce:
1.  Set a breakpoint on line 34 of MainActivity.cs - 'string s = await Bar ();'
2.  Debug the program
3.  When the debugger breaks at the line, use Step Over

Expected Result: Debugger steps over to line 35

Actual Result: Sometimes works correctly, sometimes jumps direclty to the end of the Foo method (bracket at line 37)

Step over works correctly with .Wait () or .Result.

Windows 7

Xamarin Studio
Version 4.0.10 (build 5)
Installation UUID: cee4785e-de39-4c9a-b766-7774352f26b5
	Microsoft .NET 4.0.30319.17929
	GTK 2.24.13
	GTK# (

Version: 4.8.0 (Business Edition)
Android SDK: C:\Users\Tim\AppData\Local\Android\android-sdk
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.2   (API level 17)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)
Comment 1 Timothy Risi 2013-07-22 21:03:46 UTC
Created attachment 4395 [details]
Sample app
Comment 2 Ludovic Henry 2018-01-19 16:22:39 UTC
I cannot reproduce with Mono (master/117468d740a) and VSfM 7.1.5 (build 2) on the AsyncDebuggingExample project. I didn't test with the AsyncDebuggingExampleAndroid variant, so if you can reproduce with it, please repoen. Thank you