Finite size jump history, improving backtrace, redo, undo grouping, similar for jump history

This commit is contained in:
Krzosa Karol
2025-12-26 15:40:03 +01:00
parent 509db7af46
commit 4221aa8fb7
11 changed files with 84 additions and 23 deletions

View File

@@ -1,3 +1,5 @@
typedef void OSErrorReport(const char *, ...);
#if OS_POSIX
#include <dirent.h>
#include <sys/stat.h>
@@ -54,13 +56,19 @@ void RegisterCrashHandler(void) {
struct sigaction sa;
sa.sa_sigaction = CrashHandler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART | SA_SIGINFO;
sa.sa_flags = SA_SIGINFO | SA_NODEFER | SA_RESETHAND; // Important flags!
sigaction(SIGSEGV, &sa, NULL);
sigaction(SIGABRT, &sa, NULL);
sigaction(SIGBUS, &sa, NULL);
sigaction(SIGILL, &sa, NULL);
sigaction(SIGFPE, &sa, NULL);
sigaction(SIGSEGV, &sa, NULL); // Segmentation fault
sigaction(SIGABRT, &sa, NULL); // Abort
sigaction(SIGBUS, &sa, NULL); // Bus error
sigaction(SIGILL, &sa, NULL); // Illegal instruction
sigaction(SIGFPE, &sa, NULL); // Floating point exception
sigaction(SIGTRAP, &sa, NULL); // Breakpoint/trap
sigaction(SIGSYS, &sa, NULL); // Bad system call
sigaction(SIGXCPU, &sa, NULL); // CPU time limit exceeded
sigaction(SIGXFSZ, &sa, NULL); // File size limit exceeded
sigaction(SIGTERM, &sa, NULL); // Termination request (optional)
}
API void InitOS(void (*error_proc)(const char *, ...)) {