Added a crash reporter
This commit is contained in:
parent
6548439f6c
commit
38c25bb50d
6 changed files with 121 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include "helpers/Splashes.hpp"
|
||||
#include <random>
|
||||
#include "debug/HyprCtl.hpp"
|
||||
#include "debug/CrashReporter.hpp"
|
||||
#ifdef USES_SYSTEMD
|
||||
#include <systemd/sd-daemon.h> // for sd_notify
|
||||
#endif
|
||||
|
|
@ -16,6 +17,11 @@ int handleCritSignal(int signo, void* data) {
|
|||
return 0; // everything went fine
|
||||
}
|
||||
|
||||
void handleSegv(int sig) {
|
||||
CrashReporter::createAndSaveCrash();
|
||||
exit(SIGSEGV);
|
||||
}
|
||||
|
||||
CCompositor::CCompositor() {
|
||||
wlr_log_init(WLR_INFO, NULL);
|
||||
|
||||
|
|
@ -61,6 +67,7 @@ CCompositor::CCompositor() {
|
|||
|
||||
// register crit signal handler
|
||||
wl_event_loop_add_signal(m_sWLEventLoop, SIGTERM, handleCritSignal, nullptr);
|
||||
signal(SIGSEGV, handleSegv);
|
||||
//wl_event_loop_add_signal(m_sWLEventLoop, SIGINT, handleCritSignal, nullptr);
|
||||
|
||||
m_sWLRBackend = wlr_backend_autocreate(m_sWLDisplay, &m_sWLRSession);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue