From 7ba0fb8281f23eaf83f7f78666eb527b33a2d3ec Mon Sep 17 00:00:00 2001 From: maksis Date: Sat, 9 Nov 2024 10:24:58 +0200 Subject: [PATCH] Don't install crash handlers when using a debug build Application-side crash handling causes problems with debuggers --- airdcppd/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/airdcppd/main.cpp b/airdcppd/main.cpp index 488877e3..c68ecb95 100755 --- a/airdcppd/main.cpp +++ b/airdcppd/main.cpp @@ -152,17 +152,22 @@ static void installHandler() { signal(SIGINT, &breakHandler); signal(SIGTERM, &breakHandler); + signal(SIGPIPE, SIG_IGN); + +#ifndef _DEBUG signal(SIGBUS, &handleCrash); signal(SIGFPE, &handleCrash); signal(SIGSEGV, &handleCrash); signal(SIGILL, &handleCrash); - signal(SIGPIPE, SIG_IGN); - // Note: separate from SIGTERM std::set_terminate([] { handleCrash(0); }); +#else + std::cout << "Note: using debug build, crash handlers not installed" << std::endl; +#endif + } static void setPidFilePath(const string& aConfigPath, const dcpp::StartupParams& aStartupParams) {