Search Unity

Unity 3.2 (MonoDev 2.4.2) Breakpoints/Watch in Coroutines don't work anymore.

Discussion in 'Editor & General Support' started by Inouk, Feb 16, 2011.

  1. Inouk

    Inouk

    Joined:
    Feb 16, 2011
    Posts:
    18
    Yesterday was my first full day with the new and improved Unity 3.2, thanks for all the hard work, it solved quite a few issues for me.

    Unfortunately when I started looking at the new MonoDevelop (2.4.2, C#) I found out that debugging Coroutines like I used to do was not possible anymore. In MonoDev 2.4, I was able to put breakpoints in Coroutines, step nicely in them (most of the time anyway) but more importantly I had in my Locals View a "this" parameter that I could expand and have access to all the variables declared in the Coroutine's scope. The this parameter is named <>f__this and with it, I was able to see all the other variables declared in the scope. Variables didn't have their exact names, so it was a bit tricky to use because typing the variable's name in the Watch View wouldn't work. For example:

    Code (csharp):
    1. IEnumerator TestCoroutine()
    2. {
    3.     int a = 5;
    4.     int b = 10;
    5.  
    6.     while(true)
    7.     {
    8.          a += b;
    9.          yield return null;
    10.     }
    11. }
    In Locals variable "a" would be shown as <a>__0 and "b" as <b>__1, etc.

    With 2.4.2, in Locals, I only have one variable named "this" and in the value it says that it doesn't exist in the current context. Stepping through the Coroutine's code seems less reliable but still works though.

    Does anyone else have the same problem?

    Platform: MacOSX 10.6.6
    Development: iOS Development.
     
    Last edited: Feb 17, 2011
  2. Matt_001

    Matt_001

    Joined:
    Sep 17, 2010
    Posts:
    101
    Greetings,

    I didn't noticed about the current problem Inouk brings in. But, in my case I also have Monodevelop problem since the 2.4.2 version in debugger mode. I have a simple function in a class, that function have nothing special, it's a public one and not static.

    The problem is that I cannot see most of the local variable in the Debug mode. For example, I receive in parameter a text. MonoDevelop tells me "Object reference not set to an instance of an object" in the "Watch" and "Locals" window of the debugger.

    However, if I use the same "text" parameter and I write "text.length" inside the "Watch" window, it gives me the length of the variable. Which is pretty weird, how it's able to provide me the length if (according to Monodevelop) the text holds a null reference.

    Note that the problem doesn't only occurs in that specific function, it is general to MonoDevelop. Thus, you can understand that it is Really hard to debug efficiently.

    Regards
     
  3. Matt_001

    Matt_001

    Joined:
    Sep 17, 2010
    Posts:
    101
  4. Matt_001

    Matt_001

    Joined:
    Sep 17, 2010
    Posts:
    101
    We will see if Unity 3.3 fix that as well! :D