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