When Unity crashes, it writes a minidump and some other information and pops up the Unity Bug Reporter to prompt you to report the issue. I’ve been doing C++ plugin development, and when my plugin crashes I’d like it to crash through the standard Windows crash handler so that I can attach the debugger and do postmortem analysis. How can I stop UnityBugReporter from overriding this?
Actually, I guess it was easier than I thought – just rename UnityBugReporter.exe to something else, and Unity will fall back on the standard crash handling.
Even better. Start Unity.exe AS the DLL Host App. This way, Unity itself will fall under the debugger and you will be able to use breakpoints in your DLL and take full control over Unity with your debugger. This is far, far comfortable for native plugin development. And when Unity crashes under this setup, the first thing that happens is Visual Studio (or Qt Creator, whatever IDE you use) pops up with a breakpoint in place where your plugin actually crashed Then I usually press Shift+F5 to kill Unity before it manages to run its CrashReporter (which I even renamed in my case because Unity crashes millions of times because my plugin is bugged)