1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

chore: let gdb use a single history file

This commit is contained in:
oddlama 2023-09-15 18:07:55 +02:00
parent e7561e6933
commit 451b562fd4
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A

View file

@ -1,15 +1,19 @@
{ pkgs, ... }: let {pkgs, ...}: let
# pwndbg wraps a gdb binary for us, but we want debuginfod in there too. # pwndbg wraps a gdb binary for us, but we want debuginfod in there too.
# Also make it the default gdb. # Also make it the default gdb.
pwndbgWithDebuginfod = (pkgs.pwndbg.override { pwndbgWithDebuginfod =
gdb = pkgs.gdb.override { (pkgs.pwndbg.override {
enableDebuginfod = true; gdb = pkgs.gdb.override {
}; enableDebuginfod = true;
}).overrideAttrs (_finalAttrs: previousAttrs: { };
installPhase = previousAttrs.installPhase + '' })
ln -s $out/bin/pwndbg $out/bin/gdb .overrideAttrs (_finalAttrs: previousAttrs: {
''; installPhase =
}); previousAttrs.installPhase
+ ''
ln -s $out/bin/pwndbg $out/bin/gdb
'';
});
in { in {
home.packages = [ home.packages = [
pwndbgWithDebuginfod pwndbgWithDebuginfod
@ -19,11 +23,18 @@ in {
home.file.gdbinit = { home.file.gdbinit = {
target = ".gdbinit"; target = ".gdbinit";
text = '' text = ''
set debuginfod enabled on
set auto-load safe-path / set auto-load safe-path /
set disassembly-flavor intel set debuginfod enabled on
set history save on set history save on
set history filename ~/.local/share/gdb/history
set disassembly-flavor intel
set print pretty on set print pretty on
''; '';
}; };
home.persistence."/state".directories = [
".local/share/gdb"
];
} }