[Lldb-commits] [PATCH] Allow some test suite options for dealing with crashing on Windows

Zachary Turner zturner at google.com
Thu Dec 11 15:35:04 PST 2014


================
Comment at: source/lldb.cpp:153
@@ +152,3 @@
+            // user interaction when LLDB asserts.
+            _CrtSetReportHook(AvoidMessageBoxHook);
+        }
----------------
scottmg wrote:
> zturner wrote:
> > 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);
>   _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
>   _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
>   _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
> 
I'll give that a try.  I had tried that before, but in my quest of trying different things I guess I got rid of it and never went back to it.  Certainly simpler though.

http://reviews.llvm.org/D6628

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list