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
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
File details
Details for the file gdb_pounce-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: gdb_pounce-0.0.9-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3131fa7d5ee156bc29f28986b5551c9e4399454a1837ad2f55b4d35c0976e8d |
|
MD5 | 47d28903bd4ae57311254955ded8d572 |
|
BLAKE2b-256 | 8455d0e6da791c791911b0b041ff91411f874d3ff81191543696c002792e073b |