Bug 57197 - String ctor and Evaluation with MDS
Summary: String ctor and Evaluation with MDS
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: master
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Zoltan Varga
Depends on:
Reported: 2017-06-06 18:21 UTC by Sebastien Lebreton
Modified: 2017-06-17 05:36 UTC (History)
5 users (show)

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:

Description Sebastien Lebreton 2017-06-06 18:21:51 UTC

Using a Watch with VS For Mac v7.0.1 (build 24), we can see the following:

new System.String('x', 3) -> ""
expected -> "xxx"

Comment 1 Mike Krüger 2017-06-07 08:32:18 UTC
Can't verify that bug : test case

using System;

namespace ConsProj
    class MainClass
        public static void Main(string[] args)
            var foo =  new System.String('x', 3);

Break point on writeline; watch for foo shows 'xxx' for me - doesn't matter where I add the watch with 'foo'. Version : Version 7.2 Preview (7.2)

Can you update your vs for mac to a newer build ? Seems it got fixed in more recent versions or I've another use case.
Comment 2 Sebastien Lebreton 2017-06-07 15:09:52 UTC
That's because you are not testing what I said :p

You inspected a local variable using the Watch. This is working fine for me as well.

Try to directly put the whole expression "new System.String('x', 3)" in the Watch. This is not the same thing at all.
Comment 3 Sebastien Lebreton 2017-06-08 16:12:18 UTC
Reproduced with latest public alpha (7.1 Preview, build 583)
Comment 4 David Karlaš 2017-06-08 17:34:18 UTC
I can also reproduce
Comment 5 David Karlaš 2017-06-16 07:53:41 UTC
This looks like runtime bug, I added unit test after `return;` in https://github.com/mono/mono/pull/5049
Comment 6 Zoltan Varga 2017-06-17 05:36:07 UTC
Fixed in mono master d421ee95b03dd2ffee3dcea9ef24406a5d064684.