Skip to content

Commit

Permalink
Disable the debug popup on MSVC/win32
Browse files Browse the repository at this point in the history
For not popup dialog when crash happend on MSVC/win32
related issue: jerryscript-project#4463

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
  • Loading branch information
lygstate committed Jan 16, 2021
1 parent 54003c1 commit 4f3538a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion jerry-main/main-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined (_WIN32)
#include <crtdbg.h>
#include <Windows.h>
#endif

#include "jerryscript.h"
#include "jerryscript-ext/debugger.h"
Expand Down Expand Up @@ -60,7 +64,22 @@ main (int argc,

main_args_t arguments;
arguments.sources_p = sources_p;

#if defined (_WIN32)
if (!IsDebuggerPresent ())
{
/* Disable all of the possible ways Windows conspires to make automated
testing impossible. */
#if defined (_MSC_VER)
_set_error_mode (_OUT_TO_STDERR);
_CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile (_CRT_WARN, _CRTDBG_FILE_STDERR);
_CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile (_CRT_ERROR, _CRTDBG_FILE_STDERR);
_CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile (_CRT_ASSERT, _CRTDBG_FILE_STDERR);
#endif
}
#endif
main_parse_args (argc, argv, &arguments);

#if defined (JERRY_EXTERNAL_CONTEXT) && (JERRY_EXTERNAL_CONTEXT == 1)
Expand Down

0 comments on commit 4f3538a

Please sign in to comment.