I am trying to track a certain value in a game to analyze the cause of a crash (basically, it goes to null at one point and I would like to know what exactly puts that to null as it causes issues later on). I am relatively a beginner in C# reversing as well as using DnSpy, but I couldn't find an exact way to do so leading me to believe either the feature isn't possible or if it is, I am unaware of it.
My goal is to be informed of where exactly it puts it to null with preferably a stacktrace. The best I was able to do was to breakpoint a bunch and hope for the best, but I quickly realised this is very inefficient and there has to be a better way to do this.
If it isn't possible in DnSpy itself, can I use other tools to accomplish the same thing?
If it helps, it's a Unity game which I replaced its mono dll so the DnSpy debugger works, but it can only put breakpoints in the code, not break whenever something changes at all. I can see the value in the watcher, but that's not enough.
null? Field, a property? – Paweł Łukasik Feb 15 '20 at 10:32