[PATCH 0/2] MR10250: Call abort if _wassert error behavior is set to _OUT_TO_STDERR and trigger a debug break.
If assert is called when error mode is set to _OUT_TO_STDERR and abort behavior is set to _WRITE_ABORT_MSG the abort message box is still showed in Windows. Some applications do this and don't trigger a break point in Wine because abort is never called. Note: Windows actually triggers an exception in abort, instead of calling DebugBreak. I suppose this is the behavior of ReportFault, but it's not implemented. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10250
From: Santino Mazza <smazza@codeweavers.com> --- dlls/msvcrt/exit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/msvcrt/exit.c b/dlls/msvcrt/exit.c index c8db6c405da..e451f879fbd 100644 --- a/dlls/msvcrt/exit.c +++ b/dlls/msvcrt/exit.c @@ -265,6 +265,12 @@ void CDECL abort(void) _cputs("\nabnormal program termination\n"); } #endif + +#if _MSVCR_VER > 0 + if (MSVCRT_abort_behavior & _CALL_REPORTFAULT) + DebugBreak(); +#endif + raise(SIGABRT); /* in case raise() returns */ _exit(3); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10250
From: Santino Mazza <smazza@codeweavers.com> If assert is called when error mode is set to _OUT_TO_STDERR and abort behavior is set to _WRITE_ABORT_MSG the abort message box is still showed in Windows. Some applications do this and don't trigger a break point in Wine because abort is never called. --- dlls/msvcrt/exit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/msvcrt/exit.c b/dlls/msvcrt/exit.c index e451f879fbd..9fb8e63d758 100644 --- a/dlls/msvcrt/exit.c +++ b/dlls/msvcrt/exit.c @@ -310,8 +310,7 @@ void DECLSPEC_NORETURN CDECL _wassert(const wchar_t* str, const wchar_t* file, u else fwprintf(stderr, L"Assertion failed: %ls, file %ls, line %d\n\n", str, file, line); - raise(SIGABRT); - _exit(3); + abort(); } /********************************************************************* -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10250
participants (2)
-
Santino Mazza -
Santino Mazza (@tati)