Skip to content
Snippets Groups Projects
Commit 2f8898a9 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Change SignalManager behavior in release build

Does not pause on error anymore when build type is release. In release mode,
debugger did not git more info than the back trace itself.
parent 59676019
No related branches found
No related tags found
1 merge request!11Feature/mpi
...@@ -33,7 +33,10 @@ std::string SignalManager::signalName(const int& signal) ...@@ -33,7 +33,10 @@ std::string SignalManager::signalName(const int& signal)
void SignalManager::pauseForDebug(const int& signal) void SignalManager::pauseForDebug(const int& signal)
{ {
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() << "\n======================================\n";
pout() << rang::style::reset pout() << rang::style::reset
<< rang::fg::reset << rang::fg::reset
...@@ -50,6 +53,8 @@ void SignalManager::pauseForDebug(const int& signal) ...@@ -50,6 +53,8 @@ void SignalManager::pauseForDebug(const int& signal)
pout() << std::flush; pout() << std::flush;
pause(); pause();
}
}
std::exit(signal); std::exit(signal);
} }
...@@ -89,13 +94,7 @@ void SignalManager::handler(int signal) ...@@ -89,13 +94,7 @@ void SignalManager::handler(int signal)
BacktraceManager bm; BacktraceManager bm;
perr() << bm << '\n'; perr() << bm << '\n';
if ((ConsoleManager::isTerminal(pout()) and
(s_pause_on_error == "auto")) or
(s_pause_on_error == "yes")) {
SignalManager::pauseForDebug(signal); SignalManager::pauseForDebug(signal);
} else {
std::exit(signal);
}
} }
void SignalManager::init(const bool& enable) void SignalManager::init(const bool& enable)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment