add a gdb wrapper capable of lazy loading pwndbg's gdbinit.py #307609
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
Adds a gdb wrapper whose environment is capable of lazy loading pwndbg via gdbinit.py. The use case is that I very often have to run gdb without pwndbg in order to setup initial debugging and attach to remote targets, to avoid crashes/errors, but once I hit the state that I actually want to proper analysis I load pwndbg. Some of the things that caused this to be required can be (and have been) fixed upstream in pwndbg, but the reality is day-to-day I still need use this approach and have been for years.
So the idea is from your dev shell (or wherever) you would use gdb-with-pwndbg-env (via aliasing gdb cmd or manually running), then when you actually need pwndbg you source ~/.nix-profile/share/pwndbg/gdbinit.py. The way I've been dealing with this in my devshells is using something like this:
But, I'd rather have a solution in nixpkgs itself if possible, as it will benefit other pwndbg users.
I'm open to a different name for
gdb-with-pwndbg-env
; I'm not sure if there's precedent for this type of thing elsewhere in nixpkgs, so maybe there is a standard.@Mic92 @patryk4815 @msanft
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 馃憤 reaction to pull requests you find important.