Search Unity

Debugging DOTS code with vscode

Discussion in 'Entity Component System' started by jdtec, Jun 1, 2019.

  1. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    I never had so many problems debugging code with vscode until I started using DOTs more.

    Stepping through, using breakpoints, viewing variables and connecting the debugger is extremely error prone. It goes wrong and breaks all the time.

    This leads me to resorting to printf style debugging for everything, which feels tedious.

    Does anyone know why this is? Or how I might improve my debugging experience?

    I know some of you use Rider, is that perfect in comparison? I'm tentative to try it given the yearly subscription pricing.

    Are the Unity team going to make any changes that might improve working with DOTS code with the vscode debugger?
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Debugging in Rider works fine for me, breakpoints etc. too.
     
    andywatts likes this.
  3. threedots1

    threedots1

    Joined:
    Oct 9, 2014
    Posts:
    88
    You might need to disable burst compilation while debugging your jobs.

    What seems to happen if you don't is you get one loop through your job then none of your breakpoints will trigger any more.
     
  4. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Yea I've got burst disabled temporarily on most of my jobs because of this. I get lots of other issues though anyway.

    Anyone from Unity care to comment on what their internal debugging workflow is? Which IDE and OS? I'm running on Mac, so I don't know if that's got worse support in general.
     
    GilCat likes this.
  5. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    Mac with visual studio is a nightmare :(
    Windows with visual studio is fine.
     
  6. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Just to update in case anyone else reads this I gave Rider a go and the debugger is the best I've used on Mac with Unity by someway. Works as well as visual studio does on Windows.

    I want to continue to try to use it but have found myself going back to vscode a bit at the moment as there is so much to configure and setup in Rider to get it to work how you like, might take a bit of getting use to.
     
    eterlan and GilCat like this.
  7. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,705
    VS is killing me on Mac, i might have to try Rider
     
  8. RecursiveEclipse

    RecursiveEclipse

    Joined:
    Sep 6, 2018
    Posts:
    298
    JetBrains is king imo, Pycharm/Rider are just so nice to use. I just get rainglow, set view implementation/commit hotkeys to middle mouse/Alt + C and I'm good(and change code style layouts if you need). Also make sure you get the Rider Unity plug in.
     
  9. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    Emm..I thought I can't debug in Job. I would try it later.