Bug 13640

Summary: Debugger steps to line which is not executed
Product: [Mono] Runtime Reporter: Marek Safar <masafa>
Component: DebuggerAssignee: Zoltan Varga <vargaz>
Status: RESOLVED FIXED    
Severity: normal CC: mohitk, mono-bugs+mono, mono-bugs+runtime, saurabhd
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:

Description Marek Safar 2013-07-31 03:40:16 UTC
using System;
using System.Collections.Generic;

class Test
{
	public static void Main()
	{
		var l = new List<int> ();
		foreach (var x in l)
			foreach (var y in l) // XS hits this line if it should not
				Console.Write (y);

		return;
	}
}
Comment 1 Marek Safar 2013-07-31 03:42:43 UTC
Problem is probably in

IL_000f:  br IL_0057

where IL_0057:  ldloca.s 2 does not have sequence point and sdb takes the last one instead of next one
Comment 2 Zoltan Varga 2013-07-31 20:46:15 UTC
There is an implicit seq point at 0057 becase the il stack is empty, and that il offset belongs to line 16 because:

        <entry il="0x51" row="16" col="25" file_ref="1" />
        <entry il="0x59" row="15" col="24" file_ref="1" />
Comment 3 Zoltan Varga 2014-05-11 17:09:07 UTC
Fixed by not using implicit sequence points at empty il stack locations when using symbol file based sequence points. Hopefully this won't break anything.
Comment 4 Mohit Kheterpal 2014-06-03 08:38:33 UTC
I have checked this issue but I am still getting this issue as shown in screencast : http://screencast.com/t/cCR3v4vS

However this is working fine in VS as shown in screencast : http://screencast.com/t/h64tPZNuhjdQ

Hence Reopening this issue.

Environment info :
=== Xamarin Studio ===

Version 5.1 (build 327)
Installation UUID: 449f40dd-b3f1-4028-9a6b-cca0d1a2307d
Runtime:
 Mono 3.4.0 ((no/c3fc3ba)
 GTK+ 2.24.23 (Raleigh theme)

 Package version: 304000204

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 7.2.99.420 (Enterprise Edition)
Hash: 5aa4bec
Branch: 
Build date: 2014-06-02 00:04:26-0400

=== Xamarin.Android ===

Version: 4.14.0 (Enterprise Edition)
Android SDK: /Users/360logicaxamarinmacmini/Desktop/android-sdk-macosx_Róbert_à
 Supported Android versions:
  1.6   (API level 4)
  2.1   (API level 7)
  2.2   (API level 8)
  2.3   (API level 10)
  3.1   (API level 12)
  3.2   (API level 13)
  4.0   (API level 14)
  4.0.3 (API level 15)
  4.1   (API level 16)
  4.2   (API level 17)
  4.3   (API level 18)
  4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.Mac ===

Xamarin.Mac: 1.8.0.7

=== Build Information ===

Release ID: 501000327
Git revision: 9a4bf62f59ec39169e4e9b61c3816a03c8ac961f
Build date: 2014-06-03 06:01:06-04
Xamarin addins: b68a34ef2fc4c46b045dc38e26fb199bfe1b201d

=== Operating System ===

Mac OS X 10.8.4
Darwin 360Logicas-Mac-mini.local 12.4.0 Darwin Kernel Version 12.4.0
    Sun Mar 10 18:01:10 PDT 2013
    root:xnu-2050.24.6~1/RELEASE_X86_64 x86_64
Comment 5 Zoltan Varga 2014-06-03 09:39:53 UTC
The fix will only be in mono 3.6.0 and products which use it.
Comment 6 Saurabh 2014-07-08 10:00:46 UTC
I have checked this Issue with Mono 3.6.0 and observed that when I click on Step In, XS does not hit on line which should not be. This is the screencast for the same: http://www.screencast.com/t/A9p2mGDJMd

=== Xamarin Studio ===

Version 5.2 (build 364)
Installation UUID: 2591d519-875d-4afe-a3d9-5fcf391bbd2d
Runtime:
	Mono 3.6.0 ((no/5ff701f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 306000037

=== Apple Developer Tools ===

Xcode 4.6.3 (2068)
Build 4H1503

=== Xamarin.Android ===

Version: 4.14.0 (Business Edition)
Android SDK: /Users/nischal/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)

=== Xamarin.iOS ===

Version: 7.2.6.19 (Business Edition)
Hash: 36961c5
Branch: 
Build date: 2014-07-07 10:41:50-0400

=== Xamarin.Mac ===

Version: 1.8.1.0

=== Build Information ===

Release ID: 502000364
Git revision: fd8641a35ed89a183d04290f046a3aab5b09a867
Build date: 2014-07-07 13:16:52-04
Xamarin addins: 68026ad1ccee9923e927d9cfcca408d673d5ab61

=== Operating System ===

Mac OS X 10.7.4
Darwin nischals-Mac-mini.local 11.4.0 Darwin Kernel Version 11.4.0
    Mon Apr  9 19:32:15 PDT 2012
    root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64