[Lldb-commits] [PATCH] Allow some test suite options for dealing with crashing on Windows
scottmg at chromium.org
Thu Dec 11 15:22:50 PST 2014
Comment at: source/lldb.cpp:153
@@ +152,3 @@
+ // user interaction when LLDB asserts.
> scottmg wrote:
> > I don't know if you link with /MT or /MD, but this will only work in this binary if /MT.
> Ideally I need to be able to suppress the dialog regardless of how we're linking. Is there a similar mechanism for /MD?
Sorry, I was unclear -- it will work across all exe and dlls if you're using /MD (because there's only one CRT that way), but only in this binary if /MT. I believe the only fix is to call that from every binary's main/DllMain/whatever. (Maybe this isn't really a problem if there's not actually multiple binaries involved here?)
You also may get link errors in /MT and /MD (i.e. not /MTd or /MDd), so confirm a release build works. (I can never remember, it may be fine as-is).
Instead of _CrtSetReportHook, below might be what you want (so that it prints an error/exception rather than just silently exiting).
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
More information about the lldb-commits