Breakpoints and step by step debugging destroyed by Burst, even when it's disabled

So I’ve been having this problem forever, for the whole Burst life.

There were times when I couldn’t stop the execution, or move step by step, because It kept executing empty lines or getting out of functions or not reaching breakpoints, to a point that it forced me to create new separated projects to test small things.

Disabling Burst didn’t work, disabling threads either, trying to search everywhere to find where the actual code was. Deleting Library, temp, and project files and settings.

Well. I just discovered out of frustration in a small MonoBehaviour that just called a static bursted method that when you disable Burst Compilation and compiles again, it keeps happening, as expected.
To solve it, you have to actually COMMENT OUT the [BurstCompile] attributes on top of all the chain of calls (static methods of course).

How’s that supposed to be happening? Why commenting out works, and disabling compilation doesnt?: Is there any other way?

Hey @Darkgaze,

Which debugger are you using (and what version)? And you say it happens with all the versions of Burst you have been using so far?
Sounds like a bug, could create a small repro project and report it? Then we can have a look at it.
(If you report it, can you post the issue ID here? Then we can get it assigned to the Burst team faster)

Hi @Darkgaze,

Just to follow up on @MarcoPersson’s post:

Have you tried disabling Burst from the command line? You can do that by adding the --burst-disable-compilation command line option. Does the problem persist with that?

Also, you could try disabling Burst’s debugger hooks by setting the environment variable BURST_DISABLE_DEBUGGER_HOOKS.

I’m trying with the param to disable Burst . Still not working. It doesn’t stop on a static method called from the default MonoBehaviour Update() method.

And the steps are weird (so it stops on empty lines and such).

I’m on Unity 2022.3.37f1 LTS. , Visual studio 2022. Whatever the debugger that comes with it. If you tell me how to find it…

I also used the declaration BURST_DISABLE_DEBUGGER_HOOKS with Burst enabled and disabled, and I can’t stop there either.

Test project is here:

It only works after commenting out [BurstCompile]

@MarcoPersson I’m not sure about the version. If you tell me where I can find it… not sure what you mean. It hasn’t been happening in all versions, what I mean is that I’ve been having this problem forever, in many VS versions. Randomly but when It happened there was no way to solve it.
In my current project there’s two people with me who mentioned having the same annoying problem, not being able to stop on given breakpoints, they appear as yellow with an exclamation mark.

I attach a picture of how it looks

I just reported the bug. IN-90005 - Not able to stop on Bursted code even using different methods to disable it

@Darkgaze, thank you for the test project. I have been able to reproduce the issue. I have filed a bug and we will look into resolving issue.

2 Likes

Thanks. I just wanted to say that I also reported the bug and I added the ID in the previous message in case you didn’t see or you want to merge both tickets. Thanks!!

1 Like