Bug 14953 - "Step Into" properties should "Step over", instead of "Step Over & Step Into next line", when "step over properties and operators" is set
Summary: "Step Into" properties should "Step over", instead of "Step Over & Step Into ...
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2013-09-24 09:06 UTC by Andres G. Aragoneses
Modified: 2015-01-19 16:33 UTC (History)
4 users (show)

Tags:
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 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:
Status:
RESOLVED NOT_ON_ROADMAP

Description Andres G. Aragoneses 2013-09-24 09:06:24 UTC
Steps to reproduce:

1. Create a new project, type executable.
2. Write the following code in Main.cs:

	class MainClass
	{
		public static void Main (string[] args)
		{
			Console.WriteLine ("Start");
			var son = new Son ();
			var step = son.Foo;
			son.Dispose ();
			Console.WriteLine ("End");
		}
	}

	abstract class Parent {
		internal abstract string Foo {
			get;
		}
	}
	class Son : Parent {
		internal override string Foo {
			get {
				string s = "";
				for (int i = 0; i < 50; i++ ) {
					s += "_pattern_";
				}
				return s;
			}
		}
		internal void Dispose () {
			Console.WriteLine ("Disposing");
		}
	}

3. Put a breakpoint in the line "var step = son.Foo;"
4. Start debugging, the breakpoint is hit.
5. Click on "Step Into".

Expected results: debugger should go inside Son::Foo property implementation.
Current results: debugger steps over, and steps into the next line, entering inside Son::Dispose() implementation.
Comment 1 Zoltan Varga 2013-09-24 12:03:02 UTC
So why is this an sdb bug ?
Comment 2 Andres G. Aragoneses 2013-09-24 12:20:11 UTC
Zoltan wrote:
> So why is this an sdb bug ?
Comment 3 Mikayla Hutchinson [MSFT] 2013-09-24 13:53:19 UTC
Do you have "step over properties and operators" set in MD preferences?
Comment 4 Andres G. Aragoneses 2013-09-24 14:24:19 UTC
(In reply to comment #3)
> Do you have "step over properties and operators" set in MD preferences?

Yes.
Comment 5 Jeffrey Stedfast 2013-09-24 15:30:40 UTC
that would explain why it does that, then :-)
Comment 6 Andres G. Aragoneses 2013-09-24 18:18:24 UTC
(In reply to comment #3)
> that would explain why it does that, then :-)

Oh, I actually misread the preference: I thought that the default was to allow "step into". So I'll try disabling that, thanks.

Anyway, if it's disabled, what the debugger is doing is "Step into the next instruction", but I think it should "Step over" instead of "Step over and Step into", no?

So then:

Expected results: debugger should step over, and jump to line "son.Dispose ();".
Current results: debugger steps over, and steps into the next line, entering
inside Son::Dispose() implementation.
Comment 7 Zoltan Varga 2013-09-24 18:23:41 UTC
If the preference is enabled, it means the debugger does not stop in property accessor, so if you step into a propery accessor, it steps into the next  method. This is how it should work imho.
Comment 8 Andres G. Aragoneses 2013-09-24 19:06:39 UTC
Firstly, I think that the motivation to have that as a configuration setting, even though at first surprised me, I guess it must come from the fact that, in real world code, normally you have lines of code like:

someObject.SomeMethod(someOtherObject.SomeProperty + yetOtherObj.SomeProperty)

And when you want to StepInto the code above, the programmer normally wants to step into SomeMethod, not into SomeProperty.

However, in a line of code in which there is just a property accessor, like the case explained in comment#0, I think this setting should just be ignored. Because the user hit "StepInto", and then the IDE should do what the user expected. There shouldn't be a setting to configure if I want the IDE to obey me or not.

But, I guess that the above is kind of a corner case, so I'm going to just disable the setting in my MonoDevelop and try to forget about it.

However, I really can't understand comment#7. The current behaviour especially made me think it was an IDE bug. If MonoDevelop had just step over instead of stepped into, I could actually thought of a setting like the one that exists! But this behaviour doesn't smell correct at any level.
Comment 9 Zoltan Varga 2015-01-19 14:37:36 UTC
By design.
Comment 10 Andres G. Aragoneses 2015-01-19 16:33:31 UTC
> By design.

If I find that XS doesn't behave like VS, will this bug be reopened?