Breakpoints not hit in runtime complied code using Rider and Unity

In my current Unity project I have to tackle a rather specific problem. During playtime I create runtime complied libraries using the Roslyn compiler. This works, fine, but I have some problems in debugging the source. So far I managed to create the corresponding (portable) pdbs along with the libraries, which are correctly recognized by Rider. I know this because, instead of decompiling the source, Rider shows me the updated source code.
However, it will not stop on set breakpoints anymore. This is kind a strange because if I start stepping before the beginning of the recompiled code section I can step through the "new" code without problems. Even inspecting variables seems to work nice. Is there a way to "reset" breakpoints in the code or maybe there is some config I can change to solve this problem. 

 

Things I tried without success:

-Disable/Enable Debug Mode ("Attach to Unity editor")

-Reset/Set Breakpoints in code view

-Change Debug Symbols from "Full" To "Portable" in Project Seetings->DebugAnyCPU->Debug->DebugType

-Intentionally renaming the pdb, to check if rider loads the right debug symbols. As intended this caused Rider to decompile the source because it does not find the correct pdb anymore. This means(at least for me) that Rider actually uses the right pdb.

Used Versions:

Unity 2019.3.9f1

Rider 2020.1

 

0
4 comments

Hi Dominic,

I suppose there might be problems in Rider with such breakpoints in Mono environment.

Please take the following steps:

  1. Turn on Debugger in Help -> Diagnostic Tools -> Choose Trace Scenarios
  2. Restart Rider
  3. Reproduce your issue and collect logs after that via Help -> Collect Logs
  4. Submit a request for Rider support team and attach the logs to it

We'll try to sort this out. Thank you for drawing our attention to it!

0

Thank you! I just submitted the request...

0

Thanks, just got it. We'll follow up on the request soon

0

Please sign in to leave a comment.