Merge pull request #10053 from electron/debug_mode
This commit is contained in:
commit
54e03d6edd
4 changed files with 46 additions and 6 deletions
|
@ -34,7 +34,7 @@
|
|||
|
||||
namespace {
|
||||
|
||||
const char* kRunAsNode = "ELECTRON_RUN_AS_NODE";
|
||||
const auto kRunAsNode = "ELECTRON_RUN_AS_NODE";
|
||||
|
||||
bool IsEnvSet(const char* name) {
|
||||
#if defined(OS_WIN)
|
||||
|
@ -56,6 +56,30 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
|
|||
|
||||
bool run_as_node = IsEnvSet(kRunAsNode);
|
||||
|
||||
#ifdef _DEBUG
|
||||
// Don't display assert dialog boxes in CI test runs
|
||||
static const auto kCI = "ELECTRON_CI";
|
||||
bool is_ci = IsEnvSet(kCI);
|
||||
if (!is_ci) {
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
if (!_wcsicmp(wargv[i], L"--ci")) {
|
||||
is_ci = true;
|
||||
_putenv_s(kCI, "1"); // set flag for child processes
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_ci) {
|
||||
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
|
||||
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
|
||||
|
||||
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
|
||||
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
|
||||
|
||||
_set_error_mode(_OUT_TO_STDERR);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Make sure the output is printed to console.
|
||||
if (run_as_node || !IsEnvSet("ELECTRON_NO_ATTACH_CONSOLE"))
|
||||
base::RouteStdioToConsole(false);
|
||||
|
|
|
@ -216,7 +216,7 @@ void AtomSandboxedRendererClient::InvokeIpcCallback(
|
|||
auto callback_value = binding->Get(callback_key);
|
||||
DCHECK(callback_value->IsFunction()); // set by sandboxed_renderer/init.js
|
||||
auto callback = v8::Handle<v8::Function>::Cast(callback_value);
|
||||
ignore_result(callback->Call(context, binding, args.size(), &args[0]));
|
||||
ignore_result(callback->Call(context, binding, args.size(), args.data()));
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -92,8 +92,6 @@
|
|||
'Common_Base': {
|
||||
'abstract': 1,
|
||||
'defines': [
|
||||
# We are using Release version libchromiumcontent:
|
||||
'NDEBUG',
|
||||
# Needed by gin:
|
||||
'V8_USE_EXTERNAL_STARTUP_DATA',
|
||||
# From skia_for_chromium_defines.gypi:
|
||||
|
@ -189,6 +187,7 @@
|
|||
# Use this instead of "NDEBUG" to determine whether we are in
|
||||
# Debug build, because "NDEBUG" is already used by Chromium.
|
||||
'DEBUG',
|
||||
'_DEBUG',
|
||||
# Require when using libchromiumcontent.
|
||||
'COMPONENT_BUILD',
|
||||
'GURL_DLL',
|
||||
|
@ -198,15 +197,32 @@
|
|||
],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'RuntimeLibrary': '2', # /MD (nondebug DLL)
|
||||
'RuntimeLibrary': '3', # /MDd (debug DLL)
|
||||
'Optimization': '0', # 0 = /Od
|
||||
# See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
|
||||
'BasicRuntimeChecks': '3', # 3 = all checks enabled, 0 = off
|
||||
},
|
||||
'VCLinkerTool': {
|
||||
'OptimizeReferences': 2, # /OPT:REF
|
||||
'EnableCOMDATFolding': 2, # /OPT:ICF
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
['OS=="linux"', {
|
||||
'defines': [
|
||||
'_GLIBCXX_DEBUG',
|
||||
],
|
||||
'cflags': [
|
||||
'-g',
|
||||
],
|
||||
}], # OS=="linux"
|
||||
],
|
||||
}, # Debug_Base
|
||||
'Release_Base': {
|
||||
'abstract': 1,
|
||||
'defines': [
|
||||
'NDEBUG',
|
||||
],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'RuntimeLibrary': '2', # /MD (nondebug DLL)
|
||||
|
|
2
vendor/libchromiumcontent
vendored
2
vendor/libchromiumcontent
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 8cfd08f84e415f3c8e5fde061f8e17400ef8aa7f
|
||||
Subproject commit 7a9d4a1c9c265468dd54005f6c1920b2cc2c8ec3
|
Loading…
Reference in a new issue