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

feat: use pwndbg as default gdb

This commit is contained in:
oddlama 2023-09-15 18:01:24 +02:00
parent 1a8072dcda
commit e7561e6933
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
2 changed files with 22 additions and 6 deletions

View file

@ -4,11 +4,6 @@
./yubikey.nix ./yubikey.nix
]; ];
environment.systemPackages = with pkgs; [
(gdb.override { enableDebuginfod = true; })
hotspot
];
environment.enableDebugInfo = true; environment.enableDebugInfo = true;
services.nixseparatedebuginfod.enable = true; services.nixseparatedebuginfod.enable = true;
} }

View file

@ -1,8 +1,29 @@
{ { 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 {
gdb = pkgs.gdb.override {
enableDebuginfod = true;
};
}).overrideAttrs (_finalAttrs: previousAttrs: {
installPhase = previousAttrs.installPhase + ''
ln -s $out/bin/pwndbg $out/bin/gdb
'';
});
in {
home.packages = [
pwndbgWithDebuginfod
pkgs.hotspot
];
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 history save on
set print pretty on
''; '';
}; };
} }