Bug 16664 - Wrong values displayed for captured variables
Summary: Wrong values displayed for captured variables
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger (show other bugs)
Version: 3.2.x
Hardware: PC Mac OS
: --- major
Target Milestone: ---
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2013-12-08 09:41 UTC by Marek Safar
Modified: 2014-01-22 15:51 UTC (History)
4 users (show)

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


Attachments
Shows incorrect value of pt in watch window (53.19 KB, image/png)
2013-12-23 07:16 UTC, Daniel Longhurst
Details

Description Marek Safar 2013-12-08 09:41:14 UTC
using System;

class Test  {
	static void Main ()
	{
		Action a;
		{
			for (int i = 0; i < 10; ++i) {
				a = delegate {
					Console.WriteLine (i);
				};
			}
		}

		{
			for (int i = 0; i < 10; ++i) {
				a = delegate {
					Console.WriteLine (i);
				};

				if (i > 0) // Set a breakpoint here and on first hit hover over i (shows 10) or type 'i' in Watch window
					return;
			}
		}

		return;
	}
}
Comment 1 Daniel Longhurst 2013-12-23 07:16:04 UTC
I am also experiencing this bug.  A hover over pt in the screenshot will show the same values as the watch window.  The immediate window is also affected although he return value from the method shows correctly if called from the immediate window.

This is running in the iOS simulator.

Xamarin Studio
Version 4.2.2 (build 2)
Installation UUID: de7823b4-35a1-4878-bb0c-a261427d8d42
Runtime:
	Mono 3.2.5 ((no/964e8f0)
	GTK+ 2.24.20 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302050000

Apple Developer Tools
Xcode 5.0.2 (3335.32)
Build 5A3005

Build Information
Release ID: 402020002
Git revision: c5f82958ae7d9af652b44b87ceff777b3ad19b91
Build date: 2013-11-19 15:35:40+0000
Xamarin addins: a4044fee09138f6fd031a9944b7caaeb51e57e80

Operating System
Mac OS X 10.9.1
Darwin dvl-mac 13.0.0 Darwin Kernel Version 13.0.0
    Thu Sep 19 22:22:27 PDT 2013
    root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
Comment 2 Daniel Longhurst 2013-12-23 07:16:43 UTC
Created attachment 5717 [details]
Shows incorrect value of pt in watch window

Note You need to log in before you can comment on or make changes to this bug.