Bug 6580 - 'Step Over' does not work in recursive functions
Summary: 'Step Over' does not work in recursive functions
Status: RESOLVED DUPLICATE of bug 5700
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Zoltan Varga
Depends on:
Reported: 2012-08-17 09:06 UTC by Alan McGovern
Modified: 2013-11-17 18:36 UTC (History)
6 users (show)

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

testcase (305 bytes, application/octet-stream)
2012-08-18 05:44 UTC, Alan McGovern

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 Alan McGovern 2012-08-17 09:06:06 UTC
1) Create a function which calls itself sometimes
2) Step over the invocation where the function calls itself
3) The debugger stops 1 stackframe deeper, i.e. it did not step over place where the function invoked itself, it stopped inside that invocation.
Comment 2 Alan McGovern 2012-08-17 09:07:21 UTC
This could be a runtime issue, so i CC'ed vargaz on this one.
Comment 3 Zoltan Varga 2012-08-17 15:47:35 UTC
Could you attach a test case for this ? Also, what mono version is this, 2.10 or master ?
Comment 4 Alan McGovern 2012-08-18 05:44:07 UTC
Created attachment 2373 [details]

i'm testing with mono 2.10.10. This testcase doesn't demonstrate the exact problem I described, it hits a different, but related, issue.

If you set a breakpoint in 'recurse' and run execution so you are 3 or 4 levels deep in the function and then try to step over the call to 'recurse', you end up in the wrong stackframe, it recurses the full 100 times before the step over completes.
Comment 5 Zoltan Varga 2012-08-28 14:07:18 UTC
I can reproduce this both on 2.10 and master.
Comment 6 Rodrigo Kumpera 2013-09-08 19:05:12 UTC
Zoltan, any news on this bug?
Comment 7 Alex Corrado [MSFT] 2013-11-05 16:49:45 UTC
I'm still seeing this on mono 3.2.4.. here's a really simple test case that repros 100% for me:

1) Set breakpoint on the if statement
2) When the breakpoint hits, REMOVE the breakpoint and step over the Recurse call
3) You're now on the right line (the C.WL) but wrong stack frame (i = 1)

class MainClass
	public static void Main (string[] args)
		Recurse ();

	static void Recurse (int i = 0)
		if (i < 1)
			Recurse (i + 1);
		Console.WriteLine ("i = {0}", i);
Comment 8 Alex Corrado [MSFT] 2013-11-17 18:36:30 UTC

*** This bug has been marked as a duplicate of bug 5700 ***