attach to a process precisely after a successful execve() / execveat()
Project description
gdb-pounce
Wait until a process with a certain name starts and attach to it with gdb. While for many use cases
while ! pidof "$NAME"; do :; done; gdb -p "$(pidof "$NAME")"
is sufficient, gdb-pounce will stop right at the loader entry point, as if the process was started under gdb in the first place.
Usage
python3 -m pip install --upgrade --user gdb-pounce
sudo env "PATH=$PATH" gdb-pounce [GDB OPTION]... [NAME]
When is this useful?
When an interesting process (usually a part of some complex software) starts in a non-trivial environment, for example:
As a specific user.
In a specific namespace.
With additional environment variables.
With additional file descriptors.
While another process is in a specific state.
and we need to debug its initialization.
Prerequisites
bcc >= 0.15.0
linux kernel >= 5.3 (>= 5.5 for the container support)
nsenter (for the container support, optional)
python3 >= 3.7
pounce?
gdb-pounce lies in wait for its victim process. The very moment the process appears, gdb-pounce pounces at it and seizes it, leaving it no chance to react.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for gdb_pounce-0.0.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e37c6c5d776f33ad21530ce130a4238ea8b9bbccf2117b8992ff5b0f7c2cc66 |
|
MD5 | 53c827057503cf48081041d61fe2b7fb |
|
BLAKE2b-256 | cbd5c599d9625069336a2e589740ea0c90208a76a1109ac9e4c49a82d4b1b286 |