feat: add config option to enable jit-in-time debugging

This option tells flow to start gdbserver and pause the process waiting for
gdb to connect when a crash happens.
This commit is contained in:
CJ van den Berg 2025-04-21 19:08:35 +02:00
parent a0d0a8273c
commit d9affca09b
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 5 additions and 0 deletions

View file

@ -27,6 +27,8 @@ bottom_bar: []const u8 = "mode file log selection diagnostics keybind linenumber
show_scrollbars: bool = true,
show_fileicons: bool = true,
start_debugger_on_crash: bool = false,
include_files: []const u8 = "",
pub const DigitStyle = enum {

View file

@ -103,6 +103,9 @@ fn init(allocator: Allocator) InitError!*Self {
var conf, const conf_bufs = root.read_config(@import("config"), allocator);
defer root.free_config(allocator, conf_bufs);
if (conf.start_debugger_on_crash)
tp.install_debugger();
const theme_, const parsed_theme = get_theme_by_name(allocator, conf.theme) orelse get_theme_by_name(allocator, "dark_modern") orelse return error.UnknownTheme;
conf.theme = theme_.name;
conf.whitespace_mode = try allocator.dupe(u8, conf.whitespace_mode);