summaryrefslogtreecommitdiff
path: root/src/debug/CrashReporter.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2023-03-01 15:08:44 +0000
committervaxerski <vaxry@vaxry.net>2023-03-01 15:08:44 +0000
commit6c250df77e2af7c56b1f424ea44430746160f797 (patch)
tree8d1a1baf08033f871d121283eef0c44733534d27 /src/debug/CrashReporter.cpp
parent7c5c7ced9170b5c1e34825735a720372a6c0c110 (diff)
generate coredumps on sigabrt too
Diffstat (limited to 'src/debug/CrashReporter.cpp')
-rw-r--r--src/debug/CrashReporter.cpp5
1 files changed, 3 insertions, 2 deletions
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 <sys/utsname.h>
#include <execinfo.h>
#include <fstream>
+#include <signal.h>
#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";