Bug 19258 - Debugger stepping more like .Net
Summary: Debugger stepping more like .Net
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
Depends on:
Reported: 2014-04-23 15:53 UTC by David Karlaš
Modified: 2015-07-30 06:23 UTC (History)
3 users (show)

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

List of failing tests (31.23 KB, image/png)
2014-04-23 15:53 UTC, David Karlaš

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 David Karlaš 2014-04-23 15:53:19 UTC
Created attachment 6642 [details]
List of failing tests

I created unit tests in MonoDevelop to test stepping trough code. In process I also fixed Win32 debugger stepping to work exactly as VisualStudio stepping. But SoftDebugger tests have many fails which can't be fixed in MD/debugger-libs.
Few problems that I saw are:
-When method call is finished debugger stops on method call+1 step instead on method call
-In foreach breakpoint can't be set on "in" statement
-Enumerator method with yeild calls does not step properly on first { and last }
-Stepping in foreach is very different from .Net

I think best way to approach this problem would be that someone from Runtime team checkout MD code and run tests and fix this differences.
When unit test fails it nicely says what line is expected and which line was actually stopped on.

If I can help somehow please let me know.
Comment 1 David Karlaš 2014-04-24 02:41:01 UTC
I just wanted to add one more thought about sequence points creation and Compiler vs. Runtime stepping problem. Compiler job is to create same MDB as MSBuild+pdb2mdb and rest is up to runtime this is also important for Roslyn switch...
Comment 2 David Karlaš 2015-07-30 06:23:56 UTC
I'm closing this as it's too broad and many of this issues were fixed on runtime side when using STEP_SIZE_MIN. Once mcs.exe is replaced with Roslyn for compilation, XS should change step size from Line to Min and look for bugs and open 1 by 1.