refactor: simplify logic for enabling stack dumping (#15872)

ref #15785
This commit is contained in:
Jeremy Apthorp 2018-11-28 22:23:41 -08:00 committed by GitHub
parent cd8099d336
commit 62eb077f29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,18 +155,9 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
// Logging with pid and timestamp. // Logging with pid and timestamp.
logging::SetLogItems(true, false, true, false); logging::SetLogItems(true, false, true, false);
// Enable convient stack printing. // Enable convient stack printing. This is enabled by default in non-official
#if defined(DEBUG) && defined(OS_LINUX) // builds.
bool enable_stack_dumping = true; if (env->HasVar("ELECTRON_ENABLE_STACK_DUMPING"))
#else
bool enable_stack_dumping = env->HasVar("ELECTRON_ENABLE_STACK_DUMPING");
#endif
#if defined(ARCH_CPU_ARM_FAMILY) && defined(ARCH_CPU_32_BITS)
// For 32bit ARM enabling stack printing would end up crashing.
// https://github.com/electron/electron/pull/11230#issuecomment-363232482
enable_stack_dumping = false;
#endif
if (enable_stack_dumping)
base::debug::EnableInProcessStackDumping(); base::debug::EnableInProcessStackDumping();
chrome::RegisterPathProvider(); chrome::RegisterPathProvider();