From bc6761bdc9d6bd315187c3c2c371435486012b23 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 20 Aug 2021 20:03:30 +0200 Subject: [PATCH] home: add gdb --- home/default.nix | 1 + home/gdb/default.nix | 17 +++++++++++++++++ home/gdb/gdbinit | 22 ++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 home/gdb/default.nix create mode 100644 home/gdb/gdbinit diff --git a/home/default.nix b/home/default.nix index efc4a81..2668156 100644 --- a/home/default.nix +++ b/home/default.nix @@ -10,6 +10,7 @@ ./firefox ./flameshot.nix ./gammastep.nix + ./gdb ./git ./gpg.nix ./gtk.nix diff --git a/home/gdb/default.nix b/home/gdb/default.nix new file mode 100644 index 0000000..da9434e --- /dev/null +++ b/home/gdb/default.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.home.gdb; +in +{ + options.my.home.gdb = with lib; { + enable = my.mkDisableOption "gdb configuration"; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + gdb + ]; + + xdg.configFile."gdb/gdbinit".source = ./gdbinit; + }; +} diff --git a/home/gdb/gdbinit b/home/gdb/gdbinit new file mode 100644 index 0000000..8f55b9a --- /dev/null +++ b/home/gdb/gdbinit @@ -0,0 +1,22 @@ + # Keep a history of all commands in each directory +set history save on + +# Enable those pretty-printers +enable pretty-printer + +# Pretty formatting of structures +set print pretty on +# Show derived type based on VTable +set print object on +# Show static members +set print static-members on +# Show VTable +set print vtbl on +# Demangle types +set print demangle on + +# Read python scrips in the load path +set auto-load python-scripts + +# Allow autoloading project-local .gdbinit files +add-auto-load-safe-path ~/git/