Bug 16664 - Wrong values displayed for captured variables
Summary: Wrong values displayed for captured variables
Status: RESOLVED FIXED
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: 2018-01-19 19:21 UTC (History)
5 users (show)

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


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 FIXED

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
Comment 3 Ludovic Henry 2018-01-19 19:21:54 UTC
I cannot reproduce with Mono 5.11.0.276 (master/117468d740a)