From 6c250df77e2af7c56b1f424ea44430746160f797 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Wed, 1 Mar 2023 15:08:44 +0000 Subject: generate coredumps on sigabrt too --- src/debug/CrashReporter.cpp | 5 +++-- src/debug/CrashReporter.hpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/debug') diff --git a/src/debug/CrashReporter.cpp b/src/debug/CrashReporter.cpp index 5b8c8a40..683bd951 100644 --- a/src/debug/CrashReporter.cpp +++ b/src/debug/CrashReporter.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "../plugins/PluginSystem.hpp" @@ -33,7 +34,7 @@ std::string getRandomMessage() { return MESSAGES[distribution(engine)]; } -void CrashReporter::createAndSaveCrash() { +void CrashReporter::createAndSaveCrash(int sig) { // get the backtrace const int PID = getpid(); @@ -43,7 +44,7 @@ void CrashReporter::createAndSaveCrash() { finalCrashReport += "--------------------------------------------\n Hyprland Crash Report\n--------------------------------------------\n"; finalCrashReport += getRandomMessage() + "\n\n"; - finalCrashReport += "Hyprland received signal 11 (SIGSEGV): Segmentation Fault\n\n"; + finalCrashReport += getFormat("Hyprland received signal %d (%s): Segmentation Fault\n\n", sig, strsignal(sig)); if (!g_pPluginSystem->getAllPlugins().empty()) { finalCrashReport += "Hyprland seems to be running with plugins. This crash might not be Hyprland's fault.\nPlugins:\n"; diff --git a/src/debug/CrashReporter.hpp b/src/debug/CrashReporter.hpp index b607a82f..b6750f10 100644 --- a/src/debug/CrashReporter.hpp +++ b/src/debug/CrashReporter.hpp @@ -3,5 +3,5 @@ #include "../defines.hpp" namespace CrashReporter { - void createAndSaveCrash(); + void createAndSaveCrash(int sig); }; \ No newline at end of file -- cgit v1.2.3