Search Unity

Native Debugging the Editor - Getting Mono Stacks

Discussion in 'Scripting' started by mlohstroh-playful, Feb 28, 2018.

  1. mlohstroh-playful

    mlohstroh-playful

    Joined:
    Sep 18, 2013
    Posts:
    11
    Hello,

    My team and I are dealing with an insane amount of Unity hangs and crashes. I'm trying to investigating them to get us to a more stable position, assuming that it isn't Unity's fault.

    https://docs.unity3d.com/Manual/WindowsDebugging.html

    I am following the instructions on the above page, but, instead of using it for the player, I'm attaching to the editor and pausing the program execution. Since this is native debugging, I see the managed addresses in the callstack, but I can't see the actual name of the functions that it's calling. I have all of the symbols loaded from the Unity symserver and the symbols from the Unity installation directory as well.

    I am trying to use the instruction mono_pmip to extract the function name just like it says on that previous page, but every time I do that, I get this error.

    ?mono-2.0-bdwgc.dll!mono_pmip((void*)0x135303b8)
    identifier "mono" is undefined

    I am able to extract the names in a player build, but not the editor. Is there something preventing me from getting what I need? All I'm trying to do is figure out if the managed code that the editor is stuck on is ours so I can know where to start looking next.
     
  2. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,644
    I am having the same troubles. using quotes may help "mono-2.0-bdwgc".dll!mono_pmip

    but I am getting anyway a problem in VS like:

    expected a class, struct, or union type
     
  3. rskorski-wizards

    rskorski-wizards

    Joined:
    Feb 27, 2018
    Posts:
    8
    Visual Studio's immediate window can't parse the string because there are dashes and dots in it, I think it's trying to parse it as a debugger command.

    The hint that got me there was that windbg lists the DLL with those symobls replaced with underscores. I suspected that windbg was wise on the special characters, and got rid of them for me. And if you put other characters before the first dash (ex: "monodoodoo"), then the error changes.

    Visual Studio's debugger has a special operator called the Context Operator (https://docs.microsoft.com/en-us/visualstudio/debugger/context-operator-cpp?view=vs-2019)

    ? {,,mono-2.0-bdwgc.dll}mono_pmip((void*)0x12345678)

    Using that operator, I am able to call the mono_pmip function again.
     
    sebas77 likes this.
  4. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,644