Search Unity

Breakpoints in 0.50 Entities.ForEach not working

Discussion in 'Entity Component System' started by andywatts, Apr 10, 2022.

  1. andywatts

    andywatts

    Joined:
    Sep 19, 2015
    Posts:
    112
    Anyone else having trouble with breakpoints in 0.50 Entities.ForEach lambdas?

    Rider 2021.3.4 breakpoints work in Entities 0.17 ForEach lambdas, but not in 0.50.
     
    EugenyN1 likes this.
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,998
    Can’t say I have this particular issue but rarely breakpoints did not trigger. Usually fixed by reconnecting.
    Try updating Rider plugin. Also, try the Rider EAP version, I‘m really happy with that: https://www.jetbrains.com/de-de/rider/nextversion/
     
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Yeah haven't really had any issues either. Anytime I do though a regeneration of project files usually solves it

    Edit -> Preferences -> External Tools -> Regenerate Project Files
     
  4. andywatts

    andywatts

    Joined:
    Sep 19, 2015
    Posts:
    112
    Thanks.
    Confirmed Rider breakpoints inside the ForEach lambda body are not working with 0.50 for me with fresh projects.

    Entities 0.17 works when I downgrade.
    Could be related to codegen?

     
    EugenyN1 likes this.
  5. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    I think can break point fine in rider in 0.50 ForEach.

    Are you using Rider 2021.3+? (I believe that's the minimum version that supports source generators)

    -edit-

    on second though, I can't be certain. I write very few Entities.ForEach and anything I debug would most likely be in a larger job which wouldn't be using it.
     
    Last edited: Apr 11, 2022
  6. andywatts

    andywatts

    Joined:
    Sep 19, 2015
    Posts:
    112
    Yeah. JetBrains Rider 2021.3.4
     
  7. andywatts

    andywatts

    Joined:
    Sep 19, 2015
    Posts:
    112
    Problem seems limited to Entities.ForEach.

    IJobEntity breakpoints work fine...even with a ScheduleParallel. Here's an example.
     
  8. joepl

    joepl

    Unity Technologies

    Joined:
    Jul 6, 2017
    Posts:
    87
    I'm seeing something similar and will look into it. In Rider you should be actually able to step into the Entities.ForEach (with F11 in Rider) and set breakpoints in the generated code.
     
    andywatts likes this.
  9. arielsan

    arielsan

    Joined:
    Dec 3, 2013
    Posts:
    47
    Is there any new information about this? I've just updated our project to use entities 0.51.1-preview (didn't want to but had no choice given dependencies and issues). Everything works fine but we can't debug most of the system ForEach lambdas. I tried regenerating project files but still nothing, will check later regenerating all the Library too.
     
  10. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,779
    There always were issues with debuging lambda jobs.
    0.51 seems working however. At least for me so far. So unless it is new bug?
    Did you disabled burst?
     
  11. arielsan

    arielsan

    Joined:
    Dec 3, 2013
    Posts:
    47
    It worked pretty well to us before updating to 0.51.

    I tried disabling burst and enabling it again, it doesn't work either, and tried adding breakpoints to autogenerated code and no luck, I feel like a noob with this. We have plans to move out from unity ecs and use another solution at some point and this might be one of the triggers to accelerate that process.
     
  12. JohnnyTurbo

    JohnnyTurbo

    Joined:
    May 17, 2017
    Posts:
    42
    I've been able to get this to work by disabling burst on the Entities.ForEach I want to step through just by adding the .WithoutBurst() option. Not ideal, but it works for when I need it.
     
  13. Elapotp

    Elapotp

    Joined:
    May 14, 2014
    Posts:
    98
    Recent Burst update (1.8.0-pre.2) has an interesting note in the "added" section:
    Haven't tested it yet, but looks promising