Skip to main content

attach to a process precisely after a successful execve() / execveat()

Project description

PyPI

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

gdb_pounce-0.0.11-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file gdb_pounce-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: gdb_pounce-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4

File hashes

Hashes for gdb_pounce-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 28be15ba85bec4f26735c4878def399cfddf01c378bba7ca3808eb33c7b7c39d
MD5 7240c5969e9af4ff97a13f5579b860ae
BLAKE2b-256 c9d8e9ce1ac3092922f1f377e2d980f36f07d0d96df8a9e219ea860244e6dc21

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page