MCPcopy Create free account
hub / github.com/crawl/crawl / _BreakStrToDebugger

Function _BreakStrToDebugger

crawl-ref/source/dbg-asrt.cc:780–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778// Assertions and such
779
780NORETURN static void _BreakStrToDebugger(const char *mesg, bool assert)
781{
782 UNUSED(assert);
783// FIXME: this needs a way to get the SDL_window in windowmanager-sdl.cc
784#if 0
785#if defined(USE_TILE_LOCAL) && defined(TARGET_OS_WINDOWS)
786 SDL_SysWMinfo SysInfo;
787 SDL_VERSION(&SysInfo.version);
788 if (SDL_GetWindowWMInfo(window, &SysInfo) > 0)
789 {
790 MessageBoxW(window, OUTW(mesg),
791 assert ? L"Assertion failed!" : L"Error",
792 MB_OK|MB_ICONERROR);
793 }
794 // Print the message to STDERR in addition to the above message box,
795 // so it's in the message history if we call Crawl from a shell.
796#endif
797#endif
798 fprintf(stderr, "%s\n", mesg);
799
800#if defined(TARGET_OS_WINDOWS)
801 OutputDebugString(mesg);
802 if (IsDebuggerPresent())
803 DebugBreak();
804#endif
805
806 // MSVCRT's abort() give's a funny message ...
807 raise(SIGABRT);
808 abort();
809}
810
811#ifdef ASSERTS
812NORETURN void AssertFailed(const char *expr, const char *file, int line,

Callers 3

AssertFailedFunction · 0.85
dieFunction · 0.85
die_nolineFunction · 0.85

Calls 1

UNUSEDFunction · 0.85

Tested by

no test coverage detected