Add ELECTRON_ENABLE_STACK_DUMPING env

It enables in-process stack dumping, which is convenient for debugging.
This commit is contained in:
Cheng Zhao 2015-10-20 13:02:48 +08:00
Родитель 2c4a24d26b
Коммит fb8ca33d5d
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -71,10 +71,13 @@ 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);
#if defined(DEBUG) && defined(OS_LINUX)
// Enable convient stack printing. // Enable convient stack printing.
base::debug::EnableInProcessStackDumping(); bool enable_stack_dumping = env->HasVar("ELECTRON_ENABLE_STACK_DUMPING");
#if defined(DEBUG) && defined(OS_LINUX)
enable_stack_dumping = true;
#endif #endif
if (enable_stack_dumping)
base::debug::EnableInProcessStackDumping();
return brightray::MainDelegate::BasicStartupComplete(exit_code); return brightray::MainDelegate::BasicStartupComplete(exit_code);
} }