diff --git a/src/utils/SignalManager.cpp b/src/utils/SignalManager.cpp index cd3c4251029b7dcc3c9aaee81627b96deea4e40f..c2e518a47297bc1cb5eb25d23f38b6e7afebe5a6 100644 --- a/src/utils/SignalManager.cpp +++ b/src/utils/SignalManager.cpp @@ -33,23 +33,28 @@ std::string SignalManager::signalName(const int& signal) void SignalManager::pauseForDebug(const int& signal) { - - pout() << "\n======================================\n"; - pout() << rang::style::reset - << rang::fg::reset - << rang::style::bold; - pout() << "to attach gdb to this process run\n"; - pout() << "\tgdb -pid " - << rang::fg::red - << getpid() - << rang::fg::reset - << '\n'; - pout() << "else press Control-C to exit\n"; - pout() << rang::style::reset; - pout() << "======================================\n"; - pout() << std::flush; - - pause(); + if (std::string(PASTIS_BUILD_TYPE) != "Release") { + if ((ConsoleManager::isTerminal(pout()) and + (s_pause_on_error == "auto")) or + (s_pause_on_error == "yes")) { + pout() << "\n======================================\n"; + pout() << rang::style::reset + << rang::fg::reset + << rang::style::bold; + pout() << "to attach gdb to this process run\n"; + pout() << "\tgdb -pid " + << rang::fg::red + << getpid() + << rang::fg::reset + << '\n'; + pout() << "else press Control-C to exit\n"; + pout() << rang::style::reset; + pout() << "======================================\n"; + pout() << std::flush; + + pause(); + } + } std::exit(signal); } @@ -89,13 +94,7 @@ void SignalManager::handler(int signal) BacktraceManager bm; perr() << bm << '\n'; - if ((ConsoleManager::isTerminal(pout()) and - (s_pause_on_error == "auto")) or - (s_pause_on_error == "yes")) { - SignalManager::pauseForDebug(signal); - } else { - std::exit(signal); - } + SignalManager::pauseForDebug(signal); } void SignalManager::init(const bool& enable)