Monodevelop Debugging: Breakpoints do not work in play mode.

Alright.

I’ve recently ugpraded to 5.5.0f3

Version 5.5.0f3 (38b4efef76f0) Personal
Thu, 24 Nov 2016 13:54:18 GMT
Branch: 5.5/release

And I’ve just realized that MonoDevelop debugging no longer reliably works in play mode.
Basically, good portion of my breakponts are ignored.
2876287--210934--monodevelopbug-1.png


This does not trigger debugger even when monodevelop is attached.
I can debug functions that originate from within OnDrawGizmos, though, and can successfully set breakpoints on certain lines of code. But not all of them (the way it used to work).

How do I fix this?

—Additional info–

I’m starting to suspect that editor compiles scripts in release mode with debugging information disabled. If that’s the case, I’d like to revert to the old behavior. How do I do it?

There was a similar bug on the compiler preview, evidently it hasn’t been fixed

Sigh. So, downgrading is the only option? What’s the latest version without this issue?

5.4 does still use the old compiler.

Was starting to think I had dreamed this, but here it is:
https://unity3d.com/unity/beta/unity5.5.0f1
Bug 851079

Yep, that’s the one.

1 Like

@neginfinity

It looks like bug 851079 should have been corrected in 5.5.0f3, so maybe you are seeing something slightly different.

What makes you suspect this? It indeed could be the case, but I’ve not seen anything yet here to suggest this is happening.

Also, do you know if this is specific to a certain project or to certain code from that project?

Well, if I pause debugger, I can set up breakpoings, but only on some lines (on a very small percentage of lines). For example breakpoint on line with initial initialization assignment will probably fall through (even if it assign result of a function call), but it might be possible to set up a breakpoint on some of my function calls.

Normally this kind of things happen (in C++ code, anyway), when compiler optimizations are enabled, and compiler starts optimizing things away. Meaning you see the line of code, but it is either collapsed or completely removed in the actual exe, so you can’t put a breakpoint on it.

Basically, when I setup breakpoints in monodevelop, everything looks fine, but when I attach to editor, they all get that “breakpoint with a hole in it” appearacne meaning they are not functioning (all of them). If I “pause” debugging (which will interrupt code execution), and start manually re-setting breakpoints (meaning remove and set them up again), then some breakpoints will set and work, but that’ll be a minority of them…

I ran into this issue on a nearly blank project with a single monobehavior. Basically, this was a quick test I made to experiment with something.

Do you need a repro?

@neginfinity

Thanks for the information. Although it is a pretty simple case, I would like a repro project. These debugger/breakpoint issues can be very sensitive to the specific IL code involved, so I want to be sure we can see the same thing you are seeing. Please submit a bug report with this project. Thanks!

Submitted a bug report. Case 859744

Here’s a repro project.

It has nearly no code and all breakpoints fail to trigger.

2880154–211387–MonoDevelopBreakpointBugRepro.7z (69.2 KB)

Thanks! Please ping here with the bug number when you get one.

Case 859744

1 Like

Thanks, we’ll have a look at this.

I’ll most likely will be downgrading meanwhile. As hilarious as it may sound, apparently Monodevelop seem to be the best option for unity code editing. VisualStudio has formatting bug that affects C# and greatly annoys me, and VS Code’s omnisharp seems to be intent on spamming hundreds of useless “warnings” without any fix for them.

I think that it will fail if there is a cursor after the first letter of the line that sets the breakpoint.

Speaking of which it would be great to know if there are any news about this.

I got one response from QA asking for more details, send them those details, and never heard from them back.

@neginfinity

It looks like the bug report is stuck waiting for our QA team to process your latest response. I’ll ping them to get this case moving.

Got a response from QA, the whole thing starts looking like a Heisenbug at this point. Apparently they’re unable to reproduce it on multiple machines.

I don’t suppose there is any news on this? I’m having the same problem (initially after upgrading from 5.3.5p8 to 5.5.0f3, and also on 5.5.0p4 and 5.5.1f1).

QA told me that problem does not exist in 5.6. Which appears to be true. I suggest to roll back to 5.4 till 5.6 is released as non-beta (which should happent in March). I’m currently using 5.4.3 myself.

Of course if Unity hotfixed this issue, that would be grand.